in reply to Optimizing a regex
while ( <DATAFILE> ) { m/\$(pagetitle|category)\s*=\s*\"(.*?)\"/i or next; my $which = lc($1); $pt = $2 if $pt ne "" and $which eq "pagetitle"; $pc = $2 if $pc ne "" and $which eq "category"; last if $pt ne "" and $pc ne ""; }
|
|---|