My assumption was that "pattern.re" in the loop may create a new regex from the 
string in each iteration. But maybe the compiler is indeed smart enough to 
avoid that. Generally we may investigate the search pattern in advance and fall 
back to plain string search when it is not a pattern. But I have currently no 
idea how we can easily decide if a string is a regex.

Reply via email to