] and - are special in character classes.
As rules of thumb avoiding ambiguity°:
If needed ...
D:\>perl -dE0 Loading DB routines from perl5db.pl version 1.49_05 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. DB<1> say "$_:\t", $_ =~ /[]abc-]/ for qw/] [ - a/ ]: 1 [: -: 1 a: 1 DB<2>
°) Otherwise ] will close the class and - will denote a range.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re: regex question Underscores, lines and paratheses.
by LanX
in thread regex question Underscores, lines and paratheses.
by sbrothy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |