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

StackOverflow https://stackoverflow.com/questions/18030704

  •  23-06-2022
  •  | 
  •  

Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top