Closed tdjastrzebski closed 5 years ago
See my reply to #272. Using '\\${|{'
(rather than '\\${'
) as the left delimiter should give you what you want.
thank you!
Although, the solution does not exactly solve the problem because I need to match ${x}
only and ignore {x}
.
I am trying to figure out if/how xregexp can be used to match and replace strings within the outermost matching curly braces trying to implement params name for value substitution - quite classical problem. Is such functionality currently supported? Namely: recursion or balancing groups. I know about
matchRecursive()
method but it does not seem to do what I need. Besides, it throws Unbalanced delimiter exception when string like${{}param}
is encountered. Sample code:let r = XRegExp.matchRecursive('${param1} test ${{}param2}', '\\${', '}', 'g');
Expected result: ['param1', '{}param2']