title: Sed multiple search terms
body: <p>I am not getting the behaviour I expected from sed.</p>
  
  <p>From what I can see, I should be able to use:</p>
  
  <pre><code>sed -e 's/findfirsthing/replace/;s/findsecondthing/replace/'
  </code></pre>
  
  <p>However I was unsuccessful. As you can see from the output below. Although I wanted to remove "ca." and "ca-a." from the search, it only partially worked.</p>
  
  <pre><code>macbook:labs alex$ cat ca_vip.txt
  ca.1
  ca-a.2
  3
  4
  
  macbook:labs alex$ cat vip.sh
  #!/bin/bash
      for line in `cat ca_vip.txt`
        do
          if [[ $line =~ [ca.*] || [ca-a.*] ]]
           then
               echo $line | sed -e 's/ca.//;s/ca-a.//' &gt;&gt; temporary.txt
                 elif [ $line != [ca.*] || [ca-a.*] ]
            then
              echo $line &gt;&gt; temporary.txt
          fi
      done
  
  macbook:labs alex$ ./vip.sh
  
  macbook:labs alex$ cat temporary.txt
  1
  a.2
  3
  4
  </code></pre>
  
  <p>The output I would expect is:</p>
  
  <pre><code>1
  2
  3
  4
  </code></pre>