1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Replace - Clarified regex docs (#26727)

* Clarified docs regarding multiline mode and negated character sets

Refs #26712

* Escaped newline
This commit is contained in:
Evan Kaufman 2017-08-14 14:25:08 -07:00 committed by scottb
parent 13dec9259f
commit 767be93f77

View file

@ -40,12 +40,16 @@ options:
- The regular expression to look for in the contents of the file. - The regular expression to look for in the contents of the file.
Uses Python regular expressions; see Uses Python regular expressions; see
U(http://docs.python.org/2/library/re.html). U(http://docs.python.org/2/library/re.html).
Uses multiline mode, which means C(^) and C($) match the beginning Uses MULTILINE mode, which means C(^) and C($) match the beginning
and end respectively of I(each line) of the file. and end of the file, as well as the beginning and end respectively
of I(each line) of the file.
- Does not use DOTALL, which means the C(.) special character matches
any character I(except newlines). A common mistake is to assume that
a negated character set like C([^#]) will also not match newlines.
In order to exclude newlines, they must be added to the set like C([^#\\n]).
- Note that, as of ansible 2, short form tasks should have any escape - Note that, as of ansible 2, short form tasks should have any escape
sequences backslash-escaped in order to prevent them being parsed sequences backslash-escaped in order to prevent them being parsed
as string literal escapes. See the examples. as string literal escapes. See the examples.
replace: replace:
required: false required: false
description: description: