nathaniels has asked for the wisdom of the Perl Monks concerning the following question:
I must be missing something obvious in here but I just can't seem to find it. Trying to craft a grammar using Regexp::Grammars and I can't get this code to compile. I keep getting the "Quantifier follows nothing" error.
my $token_grammar = qr { <nocontext:> <debug: on> <[unit]>+ <token: unit> <word> | <punctuation> <token: word> \b \w+ \b | <hyphenword> | <con +traction> <token: hyphenword> \b \w+ ( - | -- ) \w+ \b <token: contraction> \b \w+ ' \w \b <token: punctuation> ( \.+ | ,+ | ?+ | !+ | "+ | '+ | ;+ | : ++ | -+ | &+ | \(+ | \)+ | \[+ | \]+ ) };
I've tried reducing it to just
my $token_grammar = qr { <nocontext:> <debug: on> <[unit]>+ <token: unit> <word> <token: word> \b \w+ \b }
But this just gives be a "Nested Quantifiers" error. Any ideas? Thanks for looking!
|
|---|