Skip to content

Commit

Permalink
Note that by default the regex test is identical to match, but can do…
Browse files Browse the repository at this point in the history
… much more (ansible#50205)

* Note that the regex test behaves like 'match', with default settings
  • Loading branch information
jimrollenhagen authored and acozine committed May 7, 2019
1 parent beca366 commit 86e98c5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions docs/docsite/rst/user_guide/playbooks_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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


0 comments on commit 86e98c5

Please sign in to comment.