# regexp bug

**URL:** <https://forum.ansible.com/t/regexp-bug/19706>\
**Category:** Ansible Developer\
**Created:** [November 7, 2015, 2:34am UTC](https://forum.ansible.com/t/regexp-bug/19706 "2015-11-07T02:34:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edward\_Ned\_Harvey](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@Edward\_Ned\_Harvey](https://forum.ansible.com/u/Edward_Ned_Harvey)\
**Post date:** [November 7, 2015, 2:34am UTC](https://forum.ansible.com/t/regexp-bug/19706/1 "2015-11-07T02:34:24Z")

</div>

I am not sure if this is an ansible core bug, or a module bug, or even a python bug, so I’m not sure exactly how to report the bug. But I’m quite certain it’s a bug.

I want to comment out all lines in a file, that aren’t already commented out. So I use this:  
replace: dest=/etc/httpd/conf.d/welcome.conf regexp=‘^([^#].\*)’ replace=‘# \1’

This works fine for most lines. The .\* matches all characters up to, but not including, the newline. The problem is, for blank lines, the .\* matches the newline character. So the blank line gets commented out, and all the lines following the blank lines get skipped. The behavior is the same for .\* or .?

I’m running ansible 1.9, centos7, and python 2.7.5
