Note that by default the regex test is identical to match, but can do much more (#50205)

* Note that the regex test behaves like 'match', with default settings
pull/56190/head
Jim Rollenhagen 5 years ago committed by Alicia Cozine
parent beca3661a4
commit 86e98c5213

@ -59,8 +59,7 @@ To match strings against a substring or a regular expression, use the "match", "
msg: "matched pattern 4" msg: "matched pattern 4"
when: url is regex("example.com/\w+/foo") when: url is regex("example.com/\w+/foo")
'match' requires zero or more characters at the beginning of the string, while 'search' only requires matching a subset of the string. 'match' requires zero or more characters at the beginning of the string, while 'search' only requires matching a subset of the string. By default, 'regex' works like `search`, but `regex` can be configured to perform other tests as well.
.. _testing_versions: .. _testing_versions:
@ -266,5 +265,3 @@ The following tasks are illustrative of the tests meant to check the status of t
Have a question? Stop by the google group! Have a question? Stop by the google group!
`irc.freenode.net <http://irc.freenode.net>`_ `irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel #ansible IRC chat channel

Loading…
Cancel
Save