in reply to Re: Regex to match string with numbers with possible comma
in thread Regex to match string with numbers with possible comma

.* is greedy, consider the string found 10 results blah blah found 1,000 results. Generally .* is a subpattern to be suspicious of; I would implement your idea with something like /found (.{1,12}) results/ or /found (.*?) results/.

Replies are listed 'Best First'.
Re^3: Regex to match string with numbers with possible comma
by Roy Johnson (Monsignor) on Mar 17, 2004 at 22:10 UTC
    We're talking about a fairly predictable response, where I wouldn't expect to see multiple "found" messages. You provide one easy fix with *?. Another is:/found \S+ results/

    The PerlMonk tr/// Advocate