in reply to pattern matching through a whole document
Note:while($source =~ m!(\d{1,2})(\/|\-)(\d{1,2})(\/|\-)(\d{2,4})!g) { my $day = $1; my $month = $3; my $year = $5; # process stuff print $query->p({-align=>center},"$day $month $year"), }
Combining my notes would give you a while line
which may or may not be easier to understand.while(($day,$month,$year) = ($source =~ m!(\d{1,2})\s*(?:\/|\-)(\d{1,2})\s*\s*(?:\s*(?:\/|\-)\s* +(\d{2,4})!g) ){
|
|---|