mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
The first filter is regex_search which adds the ability to do a regex search on a fact. The filter supports returning either all capture groups or a set of capture groups (either by index or named). Example usage of regex_search filter debug: msg="{{ out.stdout[0] | regex_search('image version. (?P<test>\d+).(\d+)', '\\g<test>', '\\2' ) }}" The second filter is regex_findall with adds the capability to do a regex findall on a fact or variable and return all occurances of a pattern. debug: msg="{{ out.stdout[0] | regex_findall('vlan (\d+)' }}" The filter supports two addtional keyword arguments, ignorecase=[true, false] and multiline=[true, false] |
||
---|---|---|
.. | ||
cli | ||
compat | ||
config | ||
errors | ||
executor | ||
galaxy | ||
inventory | ||
module_utils | ||
modules | ||
new_inventory | ||
parsing | ||
playbook | ||
plugins | ||
template | ||
utils | ||
vars | ||
__init__.py | ||
constants.py | ||
test-requirements.txt |