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
This commit is contained in:
Jim Rollenhagen 2019-05-07 11:00:01 -04:00 committed by Alicia Cozine
parent beca3661a4
commit 86e98c5213

View file

@ -59,8 +59,7 @@ To match strings against a substring or a regular expression, use the "match", "
msg: "matched pattern 4"
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:
@ -199,7 +198,7 @@ The following tests can provide information about a path on the controller::
- debug:
msg: "path is {{ (mypath is abs)|ternary('absolute','relative')}}"
- debug:
- debug:
msg: "path is the same file as path2"
when: mypath is same_file(path2)
@ -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!
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel