replace module. Please explain \1 \2

I am trying to use the replace module, and I see all of these examples with \1 and \2 in them. I assume these are for backrefs or soemthing? Can someone explain it to me? I am trying to append “sss” to my passwd and group lines in my nsswitch file. I haven’t tested my code yet, but I would still like to know what \1 \2 mean. Maybe someone can point me to some documentation as I can’t seem to find anything on it myself.

`

  • name: Update nsswitch.conf
    replace:
    path: /etc/nsswitch.conf
    regexp: {{item.regexp}}
    replace: {{item.replace}}
    with_items:
  • {regexp: ‘^passwd.*’
    replace: “\1 sss” },
  • {regexp: ‘^group.*’
    replace: “\1 sss” }

`

Yes, those appear to be regex back-references. The documentation is here:

http://docs.ansible.com/ansible/latest/replace_module.html