> A new regular expression metacharacter \m would match any of the 
> following characters: ([{"'< in a regexp. A later \M metacharacter
> would match the corresponding closing pair character )]{"'> 
> I<at the same nesting level> within the string being searched. 
    ^^^^^^^^^^^^^^^^^^^^^^^^^

Language                Recognized by           Example
regular expressions     state machines          Perl REs
context-free grammer    stack machines          YACC

Regular expressions can't express nesting, and state machines can't
recognize nested constructs, because they can't count.

To express nesting, you need a context-free grammer; to recognize
nested constructs, you need a stack machine.

Going from REs to CFGs is a huge jump in the complexity of Perl, and
trading in state machines for stack machines is a huge jump in the
complexity of the interpreter.

If you need to parse nested constructs, consider using
Parse::RecDescent or Parse::Yapp.


- SWM

Reply via email to