Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Take digits from a string

by johngg (Abbot)
on Nov 26, 2012 at 17:35 UTC ( #1005723=note: print w/ replies, xml ) Need Help??


in reply to Take digits from a string

See tr in Quote and Quote like Operators (it is quite a long way down the page so be patient :-).

$ perl -E ' > $str = q{nPqwe=2456fnraqe=13910feoption}; > ( $newStr = $str ) =~ tr{0-9}{}cd; > say $newStr;' 245613910 $

I hope this is helpful.

Cheers,

JohnGG


Comment on Re: Take digits from a string
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-11-27 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (180 votes), past polls