I am a Java developer and need to write a query to remove any text that is present between the square braces.
For example, if my input is
[DATE] set for [SET] conference. Further hearing to be set.
the output should be
[] set for [] conference. Further hearing to be set.
I have come up with the following regular expression but not getting the desired output
select regexp_replace('[DATE] set for [SET] conference. Further hearing to be set.','\[[^()]*\]', '[from dual
Everything between the first open square and the last closing square is getting trimmed.
[] conference. Further hearing to be set. |
I appreciate any help on resolving this issue.
Thanks.