in reply to Re^2: pattern matching with large regex
in thread pattern matching with large regex

In your 'one_large' example you get the first match. In 'many_small' you get the last one, try adding a last when you get a match in the for loop and see what happens.

Replies are listed 'Best First'.
Re^4: pattern matching with large regex
by Anonymous Monk on Aug 13, 2005 at 22:10 UTC
    Nice catch but last won't help here because a match will be the exception. Most of the time we check it all and fail to match, but in production last definitely belongs there.