From: Fredrik Tolf Date: Wed, 14 Jul 2010 19:16:30 +0000 (+0200) Subject: ANN: Fixed name detection bug in presence of "The". X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=bbf05fd42f2da4128489460994e60a2fdc08f06a;p=utils.git ANN: Fixed name detection bug in presence of "The". --- 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]; } }