summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJames Cassell <code@james.cassell.me>2019-03-07 14:51:19 +0100
committerSam Doran <sdoran@redhat.com>2019-03-07 14:51:19 +0100
commite55e8fe2c465a32d09fccf8de4f2aab25c7d6342 (patch)
tree56896913a36f6269a55be892be0e11a179c790e5 /docs
parenthttpapi/nxos_facts: raise ConnectionError is missing `code` (#53406) (diff)
downloadansible-e55e8fe2c465a32d09fccf8de4f2aab25c7d6342.tar.xz
ansible-e55e8fe2c465a32d09fccf8de4f2aab25c7d6342.zip
regex_escape: support POSIX basic regex (#50327)
Diffstat (limited to 'docs')
-rw-r--r--docs/docsite/rst/user_guide/playbooks_filters.rst9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/docsite/rst/user_guide/playbooks_filters.rst b/docs/docsite/rst/user_guide/playbooks_filters.rst
index ab0a5f3f18..6b55c0d48f 100644
--- a/docs/docsite/rst/user_guide/playbooks_filters.rst
+++ b/docs/docsite/rst/user_guide/playbooks_filters.rst
@@ -1075,11 +1075,18 @@ To replace text in a string with regex, use the "regex_replace" filter::
.. versionadded:: 2.0
-To escape special characters within a regex, use the "regex_escape" filter::
+To escape special characters within a standard python regex, use the "regex_escape" filter (using the default re_type='python' option)::
# convert '^f.*o(.*)$' to '\^f\.\*o\(\.\*\)\$'
{{ '^f.*o(.*)$' | regex_escape() }}
+.. versionadded:: 2.8
+
+To escape special characters within a POSIX basic regex, use the "regex_escape" filter with the re_type='posix_basic' option::
+
+ # convert '^f.*o(.*)$' to '\^f\.\*o(\.\*)\$'
+ {{ '^f.*o(.*)$' | regex_escape('posix_basic') }}
+
Kubernetes Filters
``````````````````