in reply to Re: Filtering unwanted chars from input field
in thread Filtering unwanted chars from input field
Instead of spliting and greping it might be simpler to use tr (see Quote and Quote like Operators).
$ perl -E ' > @data = ( > q{Hello, world!}, > q{te-st%$/*.}, > q{All_of_this_is_OK.}, > q{!@#$%^&*()12345}, > ); > say for map { tr{A-Za-z0-9_.}{}cd; $_ } @data;' Helloworld test. All_of_this_is_OK. 12345 $
I hope this is of interest.
Cheers,
JohnGG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Filtering unwanted chars from input field
by Kenosis (Priest) on Dec 17, 2012 at 21:10 UTC | |
Re^3: Filtering unwanted chars from input field
by Anonymous Monk on Dec 18, 2012 at 14:01 UTC | |
by johngg (Canon) on Dec 18, 2012 at 14:14 UTC | |
by Anonymous Monk on Dec 19, 2012 at 20:51 UTC | |
by johngg (Canon) on Dec 19, 2012 at 23:18 UTC |
In Section
Seekers of Perl Wisdom