more useful options | |
PerlMonks |
Re: \1, \2, \3, ... inside of a character classby gmpassos (Priest) |
on Aug 12, 2004 at 20:49 UTC ( [id://382461]=note: print w/replies, xml ) | Need Help?? |
As you said, you want \1 working as the first captured occurrence in a character class ([...]). But \1 can capture much more than a single character, so, it can't be used inside a character class because it doesn't represent a character, but a string. To match multiple strings just use (?:...|\1|...).
Graciliano M. P.
In Section
Seekers of Perl Wisdom
|
|