From cf50d8131f0afea38a7dd78eab14410cc580d479 Mon Sep 17 00:00:00 2001 From: antonc42 Date: Tue, 17 Jan 2023 09:14:02 -0600 Subject: [PATCH] Fix regex filter docs (#79736) * Fix notes in regex_replace doc The documentation says that this maps to 'regex.replace' when it should say 're.replace'. The distinction is important because of the third-party 'regex' module that has more features than the built-in 're' module. https://pypi.org/project/regex/ * Fix notes in re.search docs The documentation says that this maps to 'regex.search' when it should say 're.search'. The distinction is important because of the third-party 'regex' module that has more features than the built-in 're' module. https://pypi.org/project/regex/ --- lib/ansible/plugins/filter/regex_replace.yml | 2 +- lib/ansible/plugins/filter/regex_search.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/filter/regex_replace.yml b/lib/ansible/plugins/filter/regex_replace.yml index 47c2eb3bec7..0277b5605ea 100644 --- a/lib/ansible/plugins/filter/regex_replace.yml +++ b/lib/ansible/plugins/filter/regex_replace.yml @@ -5,7 +5,7 @@ DOCUMENTATION: description: - Replace a substring defined by a regular expression with another defined by another regular expression based on the first match. notes: - - Maps to Python's C(regex.replace). + - Maps to Python's C(re.replace). positional: _input, _regex_match, _regex_replace options: _input: diff --git a/lib/ansible/plugins/filter/regex_search.yml b/lib/ansible/plugins/filter/regex_search.yml index b459c93699c..c61efb7623d 100644 --- a/lib/ansible/plugins/filter/regex_search.yml +++ b/lib/ansible/plugins/filter/regex_search.yml @@ -5,7 +5,7 @@ DOCUMENTATION: description: - Search in a string to extract the part that matches the regular expression. notes: - - Maps to Python's C(regex.search). + - Maps to Python's C(re.search). positional: _input, _regex options: _input: