ansible.builtin.regex test – Does string match regular expression from the start
Note
This test plugin is part of ansible-core and included in all Ansible
installations. In most cases, you can use the short
plugin name
regex.
However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.regex for easy linking to the
plugin documentation and to avoid conflicting with other collections that may have
the same test plugin name.
Synopsis
Compare string against regular expression using Python’s match, fullmatch or search functions.
Input
This describes the input of the test, the value before is ansible.builtin.regex or is not ansible.builtin.regex.
Parameter |
Comments |
|---|---|
String to match. |
Keyword parameters
This describes keyword parameters of the test. These are the values key1=value1, key2=value2 and so on in the following
examples: input is ansible.builtin.regex(key1=value1, key2=value2, ...) and input is not ansible.builtin.regex(key1=value1, key2=value2, ...)
Parameter |
Comments |
|---|---|
Use case insensitive matching. Choices:
|
|
Decide which function to be used to do the matching. Choices:
|
|
Match against multiple lines in string. Choices:
|
|
Regex to match against. |
Return Value
Key |
Description |
|---|---|
Returns Returned: success |
Collection links
There were some errors parsing the documentation for this plugin. Please file a bug with the ansible.builtin collection.
The errors were:
Unable to normalize regex: examples due to: 1 validation error for PluginExamplesSchema examples Input should be a valid string (type=string_type)