Reputation: 161
I am having trouble matching balanced brackets after a certain string"if". I know that I can match balanced brackets using
((?>[^()]|(?R))?\)
and that works just fine. However, when I add my string "if" before the this regular expression to be
if[ \t]*((?>[^()]|(?R))?\)
It only matches single balanced brackets after "if".
online demo: https://regex101.com/r/6lg0qi/3
Upvotes: 0
Views: 97