in reply to Performance of assambled regex

In my reply to your earlier question, I recommended that you store a compiled regex (using qr//) in your variable and showed you how to use it. The advantage of this over /o is that variables continue to work as expected.
Bill