9111efc975
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] |
||
---|---|---|
.. | ||
ansible |