|Keep It Simple, Stupid
Re^2: Is it safe to use external strings for regexes?by dave_the_m (Monsignor)
|on Oct 07, 2021 at 08:23 UTC
In the latter case, there are three issues I'm aware ofString interpolation of variables only happens for literal regexes in the source code. So if the pattern is read from a file or database this isn't an issue.
Embedded code within a pattern is only allowed within the scope of use re 'eval'; otherwise trying to compile such a regex from a string will die at run time.
The third one is a genuine issue, in terms of both CPU and memory usage.