in reply to Regex Question in Perl

Hi mmittiga,

You're using the lazy modifier to your .*. When the regex engine gets to this point, it doesn't attempt to match anything. If you know account numbers are all digits, try changing the line to:

if ( $page2 =~ m/Account number ([\d]+)/g ) {

Replies are listed 'Best First'.
Re^2: Regex Question in Perl
by ikegami (Patriarch) on Dec 22, 2010 at 18:37 UTC
    By the way, /[\d]+/ can be written /\d+/.
Re^2: Regex Question in Perl
by AnomalousMonk (Archbishop) on Dec 22, 2010 at 18:49 UTC

    ... and  /g still makes no sense.