one small suggestion for Lees version:
($name,$date1,$date2) = $input =~/^name and
date:\s(\w+,\s\w+)\s(\d\d$div\d\d$div\d\d)\sDate2:\s(\d\d$div\d\d$div\d\d)/;
----- Original Message -----
From: "Lee Goddard" <[EMAIL PROTECTED]>
To: "shil" <[EMAIL PROTECTED]>; "activeperl"
<[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 1:25 PM
Subject: Re: regex??
> HTH,
> Lee
>
> =TasK:
> Input
> name and date: Abate, Alfred 02.24.51 Date2: 09/21/00 blablabla
>
>
> output
> Name =Abate Alfred
> Date=02.24.51
> Date2=09/21/00
>
> =cut
>
> $div = "[.-/]";
> $input = 'name and date: Abate, Alfred 02.24.51 Date2: 09/21/00
blablabla';
> $input =~/^name and
>
date:\s(\w+,\s\w+)\s(\d\d$div\d\d$div\d\d)\sDate2:\s(\d\d$div\d\d$div\d\d)/;
>
> ($name,$date1,$date2) = ($1,$2,$3);
>
> print "Name: $name\nDate1: $date1\nDate2: $date2\n";
>
> __END__;
> At 16:36 13/03/2001 +0530, shil wrote:
> >Hi guys,
> > I really have problem with this regex.Here I have the string
> >containing two dates separated by either ' / ' or ' . ' or ' - '. I have
to
> >retrieve both the dates and string which comes before the first date and
> >after it.
> >
> >Input
> >name and date: Abate, Alfred 02.24.51 Date2: 09/21/00 blablabla
> >
> >output
> >Name =Abate Alfred
> >Date=02.24.51
> >Date2=09/21/00
> >
> >Thanks for the help
> >
> >
> >
> >
> >---
> >Outgoing mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.231 / Virus Database: 112 - Release Date: 2/12/01
> >
> >_______________________________________________
> >ActivePerl mailing list
> >[EMAIL PROTECTED]
> >http://listserv.ActiveState.com/mailman/listinfo/activeperl
>
>
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl