Using Filters in Ansible
filters
- search a string to extract the part that matches a regular expression.
Extract the database name from a string:
{{ 'server1/database42' | regex_search('database[0-9]+') }}
Returns: database42
Extract the database name from a string:
{{ 'server1/database42' | regex_search('database[0-9]+') }}
Returns: database42