in reply to Re^2: getting answer 70 years off
in thread getting answer 70 years off
"As for not needing to escape the '/', I'm afraid you're mistaken, at least for perl 5.14.2. I just tested it, and it doesn't compile: "Unmatched [ in regex;", ..."
I'm currently using 5.18.1 but also have 5.14.2 available: I can't reproduce the error you report:
$ perlbrew switch perl-5.14.2 $ perl -v This is perl 5, version 14, subversion 2 (v5.14.2) ... $ perl -Mstrict -Mwarnings -e 'my $re = qr{[ /\\-]}' $ perlbrew switch perl-5.18.1t $ perl -v This is perl 5, version 18, subversion 1 (v5.18.1) ... $ perl -Mstrict -Mwarnings -e 'my $re = qr{[ /\\-]}'
The perlrecharclass link I provided was for 5.18.0. The perlrecharclass documentation for 5.14.2 has the same information.
"... and vim's highlighting ends the regex there, which in my opinion is reason enough to include it, even if it is unnecessary and benign."
I also use vim with syntax highlighting. I find it has many problems, particularly with regular expressions. I don't change my code to fit in with vim's problems.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: getting answer 70 years off
by derekstucki (Sexton) on Jan 24, 2014 at 23:27 UTC | |
by kcott (Archbishop) on Jan 25, 2014 at 00:11 UTC |