Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Range of chars except one

by Anonymous Monk
on Jan 21, 2002 at 08:47 UTC ( [id://140311]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Range of chars except one
in thread Range of chars except one

True i thought about tr/// too... but "a range of chars except one", could also be read "a range of chars PLUS one" (i like to reverse things up). tr/// also offer a complement modifier to it.
So when i need to delete chars, it seems more simple to write the one i actually want to keep, preventing me to forget some:
$_ = "123,Let's keep letters!\nAnd new lines..."
tr/A-Za-z \n//cd;
print;
will print:
Lets keep letters
And new lines

Creating that range could be easier...

It's just my two cents.
Freddo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2024-04-25 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found