Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: regexp wizardry needed

by AnomalousMonk (Monsignor)
on Jan 26, 2013 at 05:31 UTC ( #1015464=note: print w/ replies, xml ) Need Help??


in reply to regexp wizardry needed

Tested under 5.8 through 5.14:

>perl -wMstrict -le "my $currentyear = '2013'; my $lines2 = ' PERIOD 13 OCT 06 OCT'; ;; $lines2 =~ s{ (\d\d) \s ([[:upper:]]{3} (?! \S)) } {\u\L$2 $1, $currentyear}xmsg; print qq{$lines2}; " PERIOD Oct 13, 2013 Oct 06, 2013


Comment on Re: regexp wizardry needed
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-07-31 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (253 votes), past polls