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.
Comment on Re^3: pattern matching with large regex
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.