See
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html
#searching-strings-with-regular-expressions
and pay careful attention to details such as punctuation and case:
1. The example is:
{{ 'foo\nBAR' | regex_search('^bar', multiline=True, ignorecase=True) }}
instead, you used:
{{ 'foo\nBAR' | regex_search("^bar", multiline=True, ignorecase=True) }}
2. The expected result is:
# => 'BAR'
whereas you say:
expected result is: "bar".
Try exactly what the example shows, and let us know if it does not produce
what the example should produce.
Antony.
--
What is this talk of "software release"?
Our software evolves and matures until it is capable of escape, leaving a
bloody trail of designers and quality assurance people in its wake.
Please reply to the list;
please *don't* CC me.