Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Re: Match number with commas

by Baz (Friar)
on Jan 30, 2003 at 22:13 UTC ( [id://231461]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Match number with commas
in thread Match number with commas

$_ = 123456789; s/ # begin substitution operator (\d{1,3}) # match and capture one-to-three digits (?= # if they are followed by: (?:\d\d\d)+ # one-or-more groups of three digits (?!\d) # that are not followed by a digit ) # end lookahead assertion /$1,/gx; # /g = perform substitution repeatedly print; #prints: 123,456,789
(_8(|)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-23 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found