in reply to Re: How to replace greedy alternation?
in thread How to replace greedy alternation?

$& imposes a needless slowdown on all regexp in your process that aren't already slowed down by captures. Use a capture instead.

Your solution assumes none of the four patterns will match twice.