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