in reply to Quantifier follows nothing error in Regexp::Grammars
The question mark is a quantifier
$ perl -le " qr{\d****} " Nested quantifiers in regex; marked by <-- HERE in m/\d** <-- HERE **/ + at -e line 1. $ perl -le " qr{(?#an error follows)****} " Quantifier follows nothing in regex; marked by <-- HERE in m/(?#an err +or follows)* <-- HERE ***/ at -e line 1. $ perl -le " qr{?} " Quantifier follows nothing in regex; marked by <-- HERE in m/? <-- HER +E / at -e line 1.
You need to learn to character class :) See perlrecharclass
Try <token: punctuation> ( [.,?!"';:\-&()\[\]]+ )
See also RFC: A walkthrough from JSON ABNF to Regexp::Grammars and The usage of <ALIAS=\IDENT> of Regexp::Grammars
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quantifier follows nothing error in Regexp::Grammars (quantifier "?")
by hdb (Monsignor) on Oct 09, 2013 at 07:14 UTC | |
by Happy-the-monk (Canon) on Oct 09, 2013 at 07:18 UTC | |
by soonix (Chancellor) on Oct 09, 2013 at 09:58 UTC | |
by Anonymous Monk on Oct 09, 2013 at 08:30 UTC | |
by hdb (Monsignor) on Oct 09, 2013 at 08:42 UTC | |
by Anonymous Monk on Oct 09, 2013 at 08:50 UTC | |
by Happy-the-monk (Canon) on Oct 09, 2013 at 08:44 UTC |