Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Take out the date using Regex.

by karlgoethebier (Parson)
on Jan 05, 2013 at 11:25 UTC ( #1011781=note: print w/replies, xml ) Need Help??

in reply to Take out the date using Regex.

Like this...

#!/usr/bin/perl use strict; use warnings; my $date_time = qq(Sat, 05 Jan 2013 04:00:15 GMT); $date_time =~ m/(.+), (\d{2} \w{3} \d{4}) (\d{2}:\d{2}:\d{2}) (\w+)/; for ( $1, $2, $3, $4 ) { print qq($_\n) } __END__ Karls-Mac-mini:monks karl$ ./ Sat 05 Jan 2013 04:00:15 GMT
Update: Edit typo...
$date_time =~ m/(.+), (.+) (.+) (.+)/;

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011781]
[Lady_Aleena]: Corion, I could give the password to the gods to hold onto just in case.
[Discipulus]: Justin Case god can always get your pwd LA ;=) they all see, they all ear, they all know ;=)
[hippo]: It may be too far down the tree for some folks to bother with, but IMHO, Re^32: global var is probably node of the day already. (++)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-04-26 08:16 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (471 votes). Check out past polls.