# uncommenting a line in file is not working

**URL:** <https://forum.ansible.com/t/uncommenting-a-line-in-file-is-not-working/29127>\
**Category:** Ansible Project\
**Created:** [November 27, 2018, 3:27pm UTC](https://forum.ansible.com/t/uncommenting-a-line-in-file-is-not-working/29127 "2018-11-27T15:27:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivek\_mv](https://avatars.discourse-cdn.com/v4/letter/v/d26b3c/32.png) [@vivek\_mv](https://forum.ansible.com/u/vivek_mv)\
**Post date:** [November 27, 2018, 3:27pm UTC](https://forum.ansible.com/t/uncommenting-a-line-in-file-is-not-working/29127/1 "2018-11-27T15:27:02Z")

</div>

Hello Experts,

my ansible play book is working for me to uncomment certain lines in a .conf file, but its failing for one particular line its not making any change.

below is my .conf file part.

→   
#\<VirtualHost \*:443\>  
#SSLEnable  
#Header always set Strict-Transport-Security “max-age=31536000; includeSubDomains; preload”  
#

→

Expected output

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 27, 2018, 4:06pm UTC](https://forum.ansible.com/t/uncommenting-a-line-in-file-is-not-working/29127/2 "2018-11-27T16:06:44Z")

</div>

You have a \* in you data, \* is a regexp special character, when you are using a special character as a literal character you need to escape it.  
So this should work:  
&nbsp;&nbsp;regexp: '^#(.\*\<VirtualHost \*:443\>.\*)'

---

<div class="post-metadata">

**Author:** ![Vivek1](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vivek1](https://forum.ansible.com/u/Vivek1)\
**Post date:** [November 27, 2018, 4:59pm UTC](https://forum.ansible.com/t/uncommenting-a-line-in-file-is-not-working/29127/3 "2018-11-27T16:59:43Z")

</div>

Hello Kai,

Great Advise!!! Thanks a lot for your help. It worked like a magic…
