2

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.

LostPhysx
  • 3,573
  • 8
  • 43
  • 73
zeno tsang
  • 735
  • 1
  • 6
  • 16

2 Answers2

3

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.

falsetru
  • 357,413
  • 63
  • 732
  • 636
  • Thanks, I managed to work it out with your suggestion, but it seems you are using the `perl engine` in ultraedit? And I used `$1` rather than `^1`. All in all, really appreciate your help. – zeno tsang Aug 03 '13 at 10:22
1

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.

icktoofay
  • 126,289
  • 21
  • 250
  • 231