How to remove the bracket in strings like "(2003)" using ultraedit and regular expressions?

954 Views Asked by At

I am going the remove the bracket for strings like "(1978)", "(2003)" in ultraedit. Actually I know how to locate these strings using a regular expression:\(\d{4}\), but I don't know how to remove the bracket. Any help would be appreciated.

2

There are 2 best solutions below

1
On BEST ANSWER

Find following pattern:

\((\d{4})\)

and replace that with:

^1

See Regular expression for Ultraedit

^1

Numerical reference to tagged expressions. Text matched with tagged expressions may be used in Replace commands with this format.

^1 corresponds to \1 or $1 (backreference) in other regular expression engines.

0
On

You should be able to define a capture group in your regular expression like this:

\((\d{4})\)

Note the unescaped parentheses. You can then use the captured text in the replacement string using \1 or $1. I'm not sure which of those two UltraEdit uses; try them both and see what works.