Replace text using regex in RAD Studio

delphi, regex

Solution

Use {} to group the expression rather than () and \1 in the replacement text:

Find Expression: `F\(G\({.+}\)\)`; Replace Expression: `H(\0)`

Problem

I want to replace for example F(G(X,Y)); with H(X,Y); In RAD Studio IDE. The regex I use is: Find Expression: `F\(G\((.+)\)\);` Replace Expression: `H($1)` The result is not as I expect: Result: `H($1)` It seems the RAD Studio does not recognize the $1 as the contents between two parentheses. Anybody have an idea? Thanks

Original source