noted that regex_escape was added in 2.0

fixes #13759
pull/4420/head
Brian Coca 2016-01-07 19:02:08 -05:00
parent 2e29993729
commit 41a417be1f
1 changed files with 4 additions and 2 deletions

View File

@ -559,6 +559,8 @@ To replace text in a string with regex, use the "regex_replace" filter::
.. note:: Prior to ansible 2.0, if "regex_replace" filter was used with variables inside YAML arguments (as opposed to simpler 'key=value' arguments),
then you needed to escape backreferences (e.g. ``\\1``) with 4 backslashes (``\\\\``) instead of 2 (``\\``).
.. versionadded:: 2.0
To escape special characters within a regex, use the "regex_escape" filter::
# convert '^f.*o(.*)$' to '\^f\.\*o\(\.\*\)\$'