title: Using sed and grep/egrep to search and replace
body: <p>I am using <code>egrep -R</code> followed by a regular expression containing about 10 unions, so like:
  <code>.jpg | .png | .gif</code> etc. This works well, now I would like to replace all strings found with <code>.bmp</code></p>
  
  <p>I was thinking of something like</p>
  
  <pre><code>egrep -lR "\.jpg|\.png|\.gif" . | sed "s/some_expression/.jpg/" file_it_came_form
  </code></pre>
  
  <p>so the issue here is how do I do a similar union regular expression in <code>sed</code> and how do I tell it to save the changes to the file that it got the input from.</p>