in reply to Re: stripping everything but numbers and letters
in thread stripping everything but numbers and letters

As you have + inside your character class, it will not be replaced

Works for me:
my $var = 'abcdef56+67jkkjk'; $var =~ s/[0-9+]//g; print "$var\n";
Gives:
abcdefjkkjk

Replies are listed 'Best First'.
Re^3: stripping everything but numbers and letters
by linuxer (Curate) on Feb 06, 2009 at 11:53 UTC

    Did you notice, that my code uses a negated character class?

    If the character class is not negated, the + is replaced; if the class is negated, it is not.