Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: need regular expression

by l.frankline (Hermit)
on Nov 02, 2005 at 09:06 UTC ( #504871=note: print w/replies, xml ) Need Help??


in reply to need regular expression

Hi,

Try this...

$_='4-10-31';

print $_ if (s/(\d{1,2})(\-\d{1,2}\-\d{1,2})/"2". 0 x (4 - length($1)+1-2).$1.$2/e);

frank.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2019-11-15 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (83 votes). Check out past polls.

    Notices?