If you decide to go the route suggested by Fletch and roboticus of writing/using a parser, you may find Parse::RecDescent useful.
HTH,
planetscapeIn reply to Re: Speeding up a large regex match pattern
by planetscape
in thread Speeding up a large regex match pattern
by wossname
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |