Regex_replace behavior changes when multi-line string used

This related topic provided the answer: multiline automatically escapes \ so this change works:

    wai2: >-
      {{ 'ansible' | regex_replace('^a.*i(.*)$', 'a\1') }}
2 Likes