title: How to comment out a particular line using ansible
body: <p>I have to comment out a line <strong>clear_me</strong> from the config file for now as part of workaround. The example file looks like this as below . I don't want to add a comment before def clear_me</p>
  
  <pre><code>def clear_me
      FactValue.where("user_id = #{id}").delete_all
    end
  
    def clear_userdata
      return unless .....  
      clear_me
      clear_reports
    end
  </code></pre>
  
  <h1>when I do this :</h1>
  
  <pre><code>- name: Comment out 
    replace:
            path: &lt;&gt;
            regexp: 'clear_me'
            replace: '#clear_me'
            backup: yes
  </code></pre>
  
  <p>I see two replacements are made ie, the clear_me before my def is also commented out . What am I missing?? :</p>
  
  <pre><code>o/p:
  changed: [localhost] =&gt; {"backup_file": "user.27018.2018-12-04@21:29:58~", "changed": true, "msg": "2 replacements made"
  
  cat &lt;file_name? | grep clear_me
    def **#clear_me**
      **#clear_me**
  </code></pre>
  
  <p>I only need to comment out the stand alone string clear_me  and not one that is in with def </p>