in reply to Re: Re: regex-matching the date
in thread regex-matching the date
As you noted, split won't be able to find your dates at all. It is a great option if you are parsing some sort of log file in which the lines always start with that date format, but if you want to get that date out of the middle of a lot of other text, a specific regex would be my choice, and instead of split you can use $1 etc. to get your date components, like:
Finally, while we're talking about OWTDI, you might also consider unpack for jobs like this as it is usually faster, though it is even more fussy about the format of the data being consistent. It is however ideal for fixed-width columns of data (anyone else still dealing with data in card images?).if /(\w{3})\s+(\w{3})\s+(\d+)/){ ($day, $month, $daynum) = ($1, $2, $3); }
--
I'd like to be able to assign to an luser
|
|---|