in reply to remove me, thank you.
in thread Regex Tuning /(?:(?:foo[34])|(?:bar[12]))\.txt/io

no, /.../o is very rarely useful, only when you are including some var $foo inside the regexp and $foo it's not going to change after the first match.

Recent perl versions include the qr// operator that allows to precompile regexp. It is what you should use when you have speed problems with dynamically generated regexps.