Hi, I have - name: update file1 with 0 in the end if it missing replace: backup: yes dest: /tmp/file1 regexp: '^(start of line.*[^0])$' replace: '\1 0'
This add 0 to lines that start with "start of line". It's run okay if there are no empty lines between. If there is empty line under the match line it add the 0 to the empty line. For example, the 2 lines: start of line fjhdsjkfhdsk will be: start of line fjhdsjkfhdsk 0 instead of: start of line fjhdsjkfhdsk 0 I tried to add the (?<!0) the look behind - but don't work at all. How can I make it catch the first new line? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/99718063-6f71-41f6-b579-acb2e6fc81cb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.