Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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

Comment on Re: Take digits from a string
Download Code

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 browsing the Monastery: (5)
As of 2015-11-25 06:36 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (671 votes), past polls