
1 May
2007
1 May
'07
9:59 a.m.
Lorenzo Bettini wrote:
do you happen to know whether there are any specifications for regular expressions for matching parenthesis (I mean in any regexp frameworks or libraries)?
Not really no, but I have another idea, assuming the x-modifier is on: (?x) (?: (\() |(\[) |(\{) ) foo (?: (?(1)\) |(?:(?(2)\] |(?:\} )))) The idea is to use conditional expressions to check which opening backet matched and then react accordingly. You'll need to check I've got the ('s and )'s matching up 'cos I lost count while typing in :-( HTH, John.