in reply to Re^2: Regex and negative file test
in thread Regex and negative file test
Part of it is that I always use m{ ... } rather than / ... / so I have lost the habit of escaping slashes. The other part is I didn't realise that there was interpolation inside a character class so, as you point out, I failed to escape the $. Ought to do the @ as well, I suppose. Not sure about the &?
$ perl -le ' > use strict; use warnings; > print q{whatever} =~ m{[\$&<>\@/]} ? q{Yep} : q{Nope};' Nope $ perl -le ' > use strict; use warnings; > print q{v$table} =~ m{[\$&<>\@/]} ? q{Yep} : q{Nope};' Yep $ perl -le ' > use strict; use warnings; > print q{bill@bloggs.com} =~ m{[\$&<>\@/]} ? q{Yep} : q{Nope};' Yep $
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regex and negative file test
by Not_a_Number (Prior) on Dec 07, 2006 at 00:29 UTC |