title: Multiple pattern replacement in sed
body: <p>I have a sed script to add a new line character in front of each keyword.</p>
  
  <pre><code>sed 's/select/\n&amp;/ig;s/where/\n&amp;/ig;s/from/\n&amp;/ig;s/and/\n&amp;/ig' 
  </code></pre>
  
  <p>is there way to shorten it? I tried the below but it did not work.</p>
  
  <pre><code>sed 's/\(select|where|from|and\)/\n&amp;/ig'
  </code></pre>
  
  <p>Please advise.</p>