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


BEGIN:VCARD
VERSION:2.1
X-GWTYPE:USER
FN:Gary Luther
TEL;WORK:0631
ORG:;Computer Center
TEL;PREF;FAX:(406) 444-0684
EMAIL;WORK;PREF;NGW:[EMAIL PROTECTED]
N:Luther;Gary
TITLE:Systems Administrator
END:VCARD


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to