title: How to replace catch block in *.java using sed?
body: <p>How to replace the following pattern in a java project  </p>
  
  <pre><code>catch(SQLException e) {
         \\TO DO
  
  }
  </code></pre>
  
  <p>with </p>
  
  <pre><code>catch(SQLException e) { S.O.P(); }
  </code></pre>
  
  <p>Please note that the file will have other patterns like </p>
  
  <pre><code>catch(IOException e) {
      // To Do }
  </code></pre>
  
  <p>which should not be changed.</p>
  
  <p>I tried </p>
  
  <pre><code>sed 's/catch\(SQLException[^\}]*}/catch(SQLException e)\{S.O.P();\}/g' file.java
  </code></pre>
  
  <p>but it does not work.</p>