Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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.

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://1005769]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2015-11-30 20:50 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 (783 votes), past polls