I'm trying to add a trailing slash to a line in a config file, but the change is not made, even though there is no error returned. This is what I've tried so far
- replace:
path: /etc/aide.conf
regexp: "/var/log LOG+ANF+ARF"
replace: "/var/log/ LOG+ANF+ARF"
backup: yes
The problem, as I have noticed, lies in the + character.
I tried escaping them like this:
- replace:
path: /etc/aide.conf
regexp: "/var/log LOG\+ANF\+ARF"
replace: "/var/log/ LOG\+ANF\+ARF"
backup: yes
but then I get a "found unknown escape character" error.
I also tried this:
regexp: r"/var/log LOG\+ANF\+ARF"
What am I doing wrong?