in reply to Re: Re: Regex - Char Class Question
in thread Regex - Char Class Question
See perlop.
Actually, see perlre.
If you're going to put a ] or - character into your character class then it has to be either escaped or be placed at the front after the optional ^,
Or placed at the end immediately before the closing square bracket.
The relevant passage from perlre:
If you want either "-" or "]" itself to be a member of a class, put it at the start of the list (possibly after a "^"), or escape it with a backslash. "-" is also taken literally when it is at the end of the list, just before the closing "]".
-sauoq "My two cents aren't worth a dime.";
|
|---|