Good day all,

Not sure If I'm doing something wrong here or hitting a bug.

Goal is to update the below line.

  <key="Token" value="some_token" />

community.windows.win_lineinfile:
  path: '{{ some_path }}'
  regex: '(.+"Token".+").+(" />)
  line: '$1{{ some_new_token }}$2'
  backrefs: true

I end up with:

$1new_token" />

I cannot get $1 to expand when placed directly next to "{{" in line.

line: '$1 {{ some_new_token }}$2'  # notice space after $1

Results in:

  <key="Token" value=" new_token" />

Changing my regex and line as below is a workaround, but I'd like to know 
what I'm missing above.

regex: '(.+"Token" value=).+'
line: '$1"{{ some_new_token}}" />'

Thank you for any insight.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7e30619b-c7a3-469c-9f5d-c5a2a3f90820n%40googlegroups.com.

Reply via email to