Question

De regular expression below is working fine to find all curly brackets ( '{' and '}' ). But I need to find double parentheses ( '((' and '))' )

/\{(((?>[^\{\}]+)|(?R))*)\}/x

Anyone who knows how to translate the above regular expression to that? It's necassary to find parentheses on multilevel. So It needs to find parentheses between parentheses as well.

Was it helpful?

Solution

It would be usefull to know which flavour of regular expressions you are using, but there is a good chance that you need to quote ( and ) characters, as they have special meaning. So replace ( with [(], and ) with [)], or use backslash to quote them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top