1

Let me take an example to show clearly the issue; say I want to match all alphabetic strings wrapped by double curly braces {{ }} which can contain curly braces as well. here is the expression i tried

/{{([A-Za-z {}()]+)}}/g

but when i give this input

"{{foo}} {{bar}}"

it matches foo}} {{bar and not foo bar as i wanted.

so my quetion is how do i solve this ? and is there a way to escape double braces in case i want to explicitly write them and not be considered by the regex ?

Xsmael
  • 3,624
  • 7
  • 44
  • 60

0 Answers0