Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Pattern Match/Trim Variables.

by fruiture (Curate)
on Feb 17, 2003 at 19:10 UTC ( #236079=note: print w/ replies, xml ) Need Help??


in reply to Pattern Match/Trim Variables.

"MM/DD/YYYY HH:MM:SS.XXX" and remove ".XXX" that's it. This directly translates to perl:

s{^ ( #capture \d{2} #MM / \d{2} #DD / \d{4} #YYYY \s+ \d{2} #HH : \d{2} #MM : \d{2} #SS ) #stop capturing \. \d{3} #XXX $} {$1}x #replace by captured

Have you read perlrequick and perlre?

--
http://fruiture.de


Comment on Re: Pattern Match/Trim Variables.
Download Code
Re: Re: Pattern Match/Trim Variables.
by LostS (Friar) on Feb 17, 2003 at 19:34 UTC
    OK after taking time and looking at what you said has greatly helped... I began to think about how the code works and looked at your information and it worked great. Thank you...

    -----------------------
    Billy S.
    Slinar Hardtail - Hand of Dane
    Datal Ephialtes - Guildless
    RallosZek.Net Admin/WebMaster

    perl -le '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat +!\n"; } else { print "Thats a dog\n"; }'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-07-06 09:09 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 (70 votes), past polls