Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Take digits from a string

by rcrews (Novice)
on Nov 26, 2012 at 22:33 UTC ( #1005769=note: print w/replies, xml ) Need Help??


in reply to Take digits from a string

Here's the simple solution you asked for:
$string =~ s/[^\d]//g;
But as several people have already mentioned, you really should read the regex docs -- perlretut, perlre, etc. Knowing all about regular expressions will greatly help you process text with Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005769]
help
Chatterbox?
[ambrus]: marto: yep, no surprise

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-10-20 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (263 votes). Check out past polls.

    Notices?