in reply to Regex to match string with numbers with possible comma

Actually, one of your assumptions appears to be wrong...

Altavista does not return "Altavista found 0 results", I just checked it, and the closest thing to a return message would probably be "We found 0 results." 'Altavista' should not be part of your regex.

So, you want to be sure to specifically test the zero case, a case of less than 1000, and a case of over 1000.

  • Comment on Re: Regex to match string with numbers with possible comma

Replies are listed 'Best First'.
Re: Regex to match string with numbers with possible comma
by Abigail-II (Bishop) on Mar 17, 2004 at 16:06 UTC
    And make sure you test values over 1,000,000 as well. Searching for 'porn' results in "AltaVista found 15,151,791 results".

    One might want to use Regexp::Common.

    Abigail