title: Python: How to add a line just before my matched pattern
body: <p>I always do append my new lines just before the pattern <code>&lt;/IfModule&gt;</code>.
  How can i accomplish this with Python.</p>
  
  <p>Just FYI, my file is not an XML/HTML to use lxml/element tree. <code>IfModule</code> is a part of my <code>.htaccess</code> file</p>
  
  <p>My idea is to reverse the file and search for the pattern , if found append my line just after it. Not so sure how to proceed with.</p>