Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Perl: the Markov chain saw
 
PerlMonks  

Re^6: Filtering unwanted chars from input field

by johngg (Abbot)
on Dec 19, 2012 at 23:18 UTC ( #1009658=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Filtering unwanted chars from input field
in thread Filtering unwanted chars from input field

The left hand side of the tr is not a regular expression. Just include a real space in the character list.

$ 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;' Hello world te-st. All_of_this_is_OK. 12345 $

Cheers,

JohnGG


Comment on Re^6: Filtering unwanted chars from input field
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2014-04-16 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (432 votes), past polls