title: Can 'sed' do 'or' class trimming?
body: <p>I am working with a piece of code but it's ugly. It has a nasty line in it along the lines of:</p>
  
  <pre><code>s/COM/ALPHA BETA GAMMA COM/g
  s/DLX/ALPHA BETA GAMMA DLX/g
  s/BE4/ALPHA BETA GAMMA BE4/g
  s/BE2/ALPHA BETA GAMMA BE2/g
  s/RS/ALPHA BETA GAMMA RS/g
  </code></pre>
  
  <p>If any of <code>BE2</code>, <code>RS</code>, etc. are found then it will replaced with <code>Alpha Beta Gamma COM/DLX/BE4/BE2/RS</code>. However, if all three are found then each one will be replaced. Since the ideal output would be:</p>
  
  <pre><code>ALPHA BETA GAMMA COM DLX BE4 BE2 RS
  </code></pre>
  
  <p>is there anyway to code this in sed please? It is truly "either NED or JED or TED." Alternatively, can other Linux be used?</p>