I need to find a string match at Microsoft site. Out of its web page, there could be one or more strings look like this:
<a class="download" onclick="return false;" href="confirmation.aspx?id=36888" bi:fileurl="8/D/5/8D5F90F3-AC24-4A15-9716-BAE10533977A/Windows6.0-KB2809289-x86.msu"
var downloadFileUrl = "8/D/5/8D5F90F3-AC24-4A15-9716-BAE10533977A/Windows6.0-KB2809289-x86.msu" ;
$("#ctl00_ctl21_ColumnRepeater_ctl00_RowRepeater_ctl01_CellRepeater_ctl00_ctl01").details({ "downloadUrl": "8/D/5/8D5F90F3-AC24-4A15-9716-BAE10533977A/Windows6.0-KB2809289-x86.msu", "enableAtlasActionTag": true, "atlasActionTag": ""
The regexp I came up is somewhat like this:
I then have two implementations:
Implementation I:
The error I got is like this:
Implementation II:
No match is found. So I know the regexp is incorrect.
Please help me in two areas:
1) fix my regexp;
2) with a correct regexp, would I still get this error - Complex regular subexpression recursion limit (32766) exceeded?
Many thanks!!
<a class="download" onclick="return false;" href="confirmation.aspx?id=36888" bi:fileurl="8/D/5/8D5F90F3-AC24-4A15-9716-BAE10533977A/Windows6.0-KB2809289-x86.msu"
var downloadFileUrl = "8/D/5/8D5F90F3-AC24-4A15-9716-BAE10533977A/Windows6.0-KB2809289-x86.msu" ;
$("#ctl00_ctl21_ColumnRepeater_ctl00_RowRepeater_ctl01_CellRepeater_ctl00_ctl01").details({ "downloadUrl": "8/D/5/8D5F90F3-AC24-4A15-9716-BAE10533977A/Windows6.0-KB2809289-x86.msu", "enableAtlasActionTag": true, "atlasActionTag": ""
The regexp I came up is somewhat like this:
Code:
my $kb = '[b]KB2809289[/b]';
my $pattern = qq/http:\/\/download\.microsoft\.com\/download[b][COLOR=#EF2929]([\\d+\\D+\\w+\W+]+)[/color]+[/b]$kb\.msu/;
I then have two implementations:
Implementation I:
Code:
my $pattern = qq/http:\/\/download\.microsoft\.com\/download([\\d+\\D+\\w+\W+]+)+$kbName\.msu/;
my $contents = `cat $srce`; # The Microsoft page has been saved as a local file
my $i = 1;
while($contents =~ /($pattern)/g) {
my $match = $&;
print ("\$i = $i, $match\n");
$i++;
}
Code:
Complex regular subexpression recursion limit (32766) exceeded at <file name> line 3348.
Implementation II:
Code:
if(open(FH, $srce)) {
my $i = 1;
while(my $line = <FH>) {
if($line =~ /($pattern)/g) {
my $match = $1;
print ("\$i = $i, $match\n");
}
$i++;
}
close(FH);
}
Please help me in two areas:
1) fix my regexp;
2) with a correct regexp, would I still get this error - Complex regular subexpression recursion limit (32766) exceeded?
Many thanks!!