title: sed and regex to prepend line
body: <p>I'm trying to find a way to search in a  files and add a line before the a string
  I want to search for</p>
  
  <pre><code>xxx =  text() // '=' folowed by space or not then  'text()'
  </code></pre>
  
  <p>if found :</p>
  
  <p>add before this line </p>
  
  <pre><code>new text
  </code></pre>
  
  <p>in other word i want this</p>
  
  <pre><code>xxx =  text()
  </code></pre>
  
  <p>to be this :</p>
  
  <pre><code>new text
  xxx =  text()
  </code></pre>
  
  <p>i tried this</p>
  
  <pre><code>find /var/www/users/ \( -name '*.py'   \)  -type f  -exec sed -i 's|\s+\=\s+\text()|new text|i' {} \;
  </code></pre>