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

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-04-21 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (493 votes), past polls