in reply to Re^2: Regex: first match that is not enclosed in parenthesis
in thread Regex: first match that is not enclosed in parenthesis

Sounds like what you really need is a lexer.

hdb regularly posts such solutions based on dispatch tables, worth searching for...

HTH! =)

Cheers Rolf

( addicted to the Perl Programming Language)

  • Comment on Re^3: Regex: first match that is not enclosed in parenthesis