The ^ at the start indicates match from the start of a new line.
You don't need this. Try:-
$look =~ /\w{4}\:??\s+([\d\/]+)/;
Gary Luther wrote:
>
> I am having to parse dates out of lines where the date format varies considerably.
>
> Here is the statement that is contained in $look
>
> EFFECTIVE DATE: 07/12/01 DAILY CUSTOMER ACCOUNT REPORT
> RUN DATE: 07/13/01
>
> There are two blanks (in this particular file in front of the EFFECTIVE.
> The DATE: 07/12/01 can appear in slightly varying formats from report to report. The
>possibilities are:
>
> DATE: nn/nn/nn
> DATE nn/nn/nn
> DATE : nn/nn/nn
> DATE: nn/nn/nnnn
>
> and perhaps more that I have yet to discover. Here is the match statement I am using
>to parse out the date:
>
> $look =~ /^\s*DATE\s?\W?\s+(\d{2}\/\d{2}\/\d{2,4})/;
>
> What I expect in $1 is 07/12/01
>
> The \W? is for the disappearing colon (:)
>
> I have run several programs through that have a similar structure and they seem to
>work but this one fails for some reason.
>
> So...Guru's I would appreciate your inciteful reflections and / or incantations as
>to why this is not working.
>
> TIA
>
> --
> -------------------------------------------------------------------------
> "They that can give up essential liberty
> to obtain a little temporary safety
> deserve neither liberty nor safety."
>
> -- Benjamin Franklin
> -------------------------------------------------------------------------
> RRRRR Gary Luther
> RR RR SAF
> RR RR UTABEGAS 2500 Broadway
> RR RR Helena, MT 59602
> RRRR [EMAIL PROTECTED]
> RR RR ULE !!
> RR RR Visit our website at
> RR RR http://www.safmt.org
>
> ------------------------------------------------------------------------
>
> Gary Luther.vcfName: Gary Luther.vcf
> Type: Plain Text (text/plain)
>
> ------------------------------------------------------------------------
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
David Wood, Web Developer<br>
[a] Clickmusic Ltd, 99c Talbot Road, London W11 2AT<br>
[t] 020 7727 7500
<br>[w] www.clickmusic.co.uk<br>
<br>"There are three types of people in the world; those who can count,
and those who can't."
<br> </html>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]