Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Take digits from a string

by 2teez (Priest)
on Nov 26, 2012 at 13:56 UTC ( #1005665=note: print w/replies, xml ) Need Help??

in reply to Take digits from a string

"..Is it possible to get this using any regex,pls?.."
Yes, something like so:

my $string = "nPqwe=2456fnraqe=13910feoption"; if ( my @digits = $string =~ m/[0-9]/g ) { print @digits; # print 245613910 }
Please also check perlrequick

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2016-10-20 21:07 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (283 votes). Check out past polls.