Re: Regex giving me fits!! :-(

2001-07-19 Thread insomniak
= $3; # check for years 19xx, 20xx or xx Regards Mark - Original Message - From: "Gary Luther" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 17, 2001 3:31 PM Subject: Regex giving me fits!! :-( I am having to parse dates out of lines w

Re: Regex giving me fits!! :-(

2001-07-17 Thread Luke Bakken
> this should work, tho i haven't tried it: > > $look =~ m!DATE[ :]+(\d{2}/\d{2}\d{2,4})!; should read: $look =~ m!DATE[ :]+(\d{2}/\d{2}/\d{2,4})!; ^ that's what i get for not trying it! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

Re: Regex giving me fits!! :-(

2001-07-17 Thread Abdulaziz Ghuloum
It's working here!! Aziz,,, #!/usr/bin/perl -w for $look(){ $look =~ /^\s*DATE\s?\W?\s+(\d{2}\/\d{2}\/\d{2,4})/; print ++$i . " $1\n"; } __DATA__ DATE: 12/12/12 DATE 12/12/12 DATE : 12/12/12 DATE: 12/12/1212 In article <[EMAIL PROTECTED]>, "Gary Luther" <[EMAIL PROTECTED]> wrote: >

Re: Regex giving me fits!! :-(

2001-07-17 Thread Luke Bakken
> EFFECTIVE DATE: 07/12/01DAILY CUSTOMER ACCOUNT REPORT > RUN DATE: 07/13/01 > DATE: nn/nn/nn > DATE nn/nn/nn > DATE : nn/nn/nn > DATE: nn/nn/ > > $look =~ /^\s*DATE\s?\W?\s+(\d{2}\/\d{2}\/\d{2,4})/; First off, if you have literal s

Re: Regex giving me fits!! :-(

2001-07-17 Thread David Wood
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 > > EF

Regex giving me fits!! :-(

2001-07-17 Thread Gary Luther
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/01DAILY CUSTOMER ACCOUNT REPORT RUN DATE: 07/13/01 There are two blanks (in this