Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: regexp wizardry needed

by AnomalousMonk (Abbot)
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 wandering the Monastery: (17)
As of 2015-07-29 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (265 votes), past polls