If it's worthwhile to take the regexp compiling outside of the inner while, it's probably worthwhile to take the split out too.
If we knew what you were doing, including having a idea what the patterns are, we might be able to provide a better algorithm.
In reply to Re: Efficient regex matching with qr//; Can I do better?
by ikegami
in thread Efficient regex matching with qr//; Can I do better?
by kruppy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |