From 1e2b332001784ec6adf9c7c8cfdcd0d0b814da46 Mon Sep 17 00:00:00 2001 From: Chris Smolen Date: Thu, 19 Jul 2018 16:02:49 -0700 Subject: [PATCH] Update the regex_findall example (#43052) The example has: `{{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b') }}` It needs be double backslashes to escape the backslashes: `{{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\b') }}` +label: docsite_pr --- docs/docsite/rst/user_guide/playbooks_filters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/user_guide/playbooks_filters.rst b/docs/docsite/rst/user_guide/playbooks_filters.rst index 6fb1c8ab12..826a741690 100644 --- a/docs/docsite/rst/user_guide/playbooks_filters.rst +++ b/docs/docsite/rst/user_guide/playbooks_filters.rst @@ -992,7 +992,7 @@ To search a string with a regex, use the "regex_search" filter:: To search for all occurrences of regex matches, use the "regex_findall" filter:: # Return a list of all IPv4 addresses in the string - {{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b') }} + {{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\b') }} To replace text in a string with regex, use the "regex_replace" filter::