Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: need regular expression

by tilly (Archbishop)
on Nov 02, 2005 at 08:17 UTC ( #504864=note: print w/replies, xml ) Need Help??


in reply to Re^2: need regular expression
in thread need regular expression

The listed examples didn't indicate to me that we need to worry about anything other than the first number, and adding 2000 to a 1 digit number definitely results in a 4 digit one. :-)

But if that's your spec, then try s/(\d?\d)-(\d?\d)-(\d?\d)/sprintf("20%02d-%02d-%02d", $1, $2, $3)/eg

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2019-11-19 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (94 votes). Check out past polls.

    Notices?