# adding escape characters in replace module

**URL:** <https://forum.ansible.com/t/adding-escape-characters-in-replace-module/32344>\
**Category:** Ansible Developer\
**Created:** [February 27, 2020, 3:52pm UTC](https://forum.ansible.com/t/adding-escape-characters-in-replace-module/32344 "2020-02-27T15:52:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anil](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@Anil](https://forum.ansible.com/u/Anil)\
**Post date:** [February 27, 2020, 3:52pm UTC](https://forum.ansible.com/t/adding-escape-characters-in-replace-module/32344/1 "2020-02-27T15:52:42Z")

</div>

Hi All,

I have file below, would like to comment out the line with hmac-sha1 and uncomment like with #Commened for LINUXMSB 2013’

$ cat sshd\_config  
MACs [hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256](mailto:hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256)  
#Added below for LINUXMSB 2013  
MACs hmac-sha2-512,hmac-sha2-256,hmac-sha1

Interestingly if dont use loop(with\_items), it works fine. When i use with with\_item, it adds another escape character, Am i missing something?

Here is the code:

$ cat sshd.yml
