Using replace well

Okay, this might not be the most kludgy task list ever, but I think it’s in the running. The goal is to edit Apache’s httpd.conf file to ensure certain Options are set and certain other ones aren’t. The issues I’ve run in to, besides learning Ansible’s regex, is that sometimes ‘\s’ will match a newline but when the backref is in place it won’t put the new line in. Also, trying to match specific words that may be on the end of a line or in the middle, but not a part of a longer phrase. For example, to match “Includes” but not “IncludesNoExec”.

Another issue is the number of backrefs; If there’s no match then the positional \4 can fail.

Critique welcome!

Leam