From bbf05fd42f2da4128489460994e60a2fdc08f06a Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 14 Jul 2010 21:16:30 +0200 Subject: [PATCH] ANN: Fixed name detection bug in presence of "The". --- ANN.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ANN.pm b/ANN.pm index 8b311f4..f10e869 100644 --- a/ANN.pm +++ b/ANN.pm @@ -58,9 +58,9 @@ sub getlist # The only way to recognize entries that seems sure is to look # after the "HOVERLINE" class. - while($html =~ /(\.*\<\/small\>)?([^<]+)<\//ig) { - if((substr "" . lc $3 , 0, length $name) eq lc $name) { - push @ret, $3; + while($html =~ /]*>(]*>)?(\.*\<\/small\>)?\s*([^<]+)<\//ig) { + if((substr "" . lc $4 , 0, length $name) eq lc $name) { + push @ret, $4; } } # push @ret, $1 while $html =~ /.*([^<>]*$name[^<>]*)<\/FONT/ig; @@ -83,8 +83,8 @@ sub getid # The only way to recognize entries that seems sure is to look # after the "HOVERLINE" class. - while($html =~ /(\.*\<\/small\>)?([^<]+)<\//ig) { - if((substr "" . lc $3 , 0, length $name) eq lc $name) { + while($html =~ /]*>(]*>)?(\.*\<\/small\>)?\s*([^<]+)<\//ig) { + if((substr "" . lc $4 , 0, length $name) eq lc $name) { return ($1 =~ /id=(\d+)$/)[0]; } } -- 2.11.0