Re: grouping regex match return values

2002-09-18 Thread Mohd Salman
Nope, Try cluster patterns , so rewrite $day,$month,$year as $day="(?:[12]?[0-9]|30|31)"; etc >From: "Rum Pel" <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: grouping regex match return values >Date: Wed, 18 Sep 2002 00:17:44 -0400 > > >I want to pick dates from a file, I did it the

RE: grouping regex match return values

2002-09-18 Thread Rum Pel
not want a or B, only aB's. I cannot remove inner parentheses as it would be /(a|Ab|B)/ which is not what I want. Is my problem clear? >From: Timothy Johnson <[EMAIL PROTECTED]> >To: "'Rum Pel'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: RE:

RE: grouping regex match return values

2002-09-18 Thread Timothy Johnson
How about this? while($_ =~ /(\d{1,2}\/\d{1,2}\/\d{4})/g){ push @q,$1; } Perl assigns the variable $1 to the first match in parentheses. ($2 for the next match within the same regex, and so on) The regex above matches: One or two digits \d{1,2} followed by a backslash