laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
(I work with dk.) Another question could be: why is the one with the capture groups so slow, since none of the words match the string? And in general, why is alternation&capture so much slower than looping&capture + alternation combined? The reason for the code is to replace code with 60 or so similarly structured regexes in a library used by a couple of legacy applications with an automatically generated regex generated with info from configuration files, for both (potential) performance gains, allowing different behaviour across applications, and definite maintainability gains. The strings replaced all have the structure \bFOO:\s*bar(\d+) or \bBAZ:\s*(\w+) etc. Suggestions like "Well, don't do that" are likely to go unheard :-) In reply to Re^2: alternation in regexes: to use or to avoid?
by balker
|
|