On top of what already has been said, lose the modifiers. In your case, the
/o is pointless. In the few regexes where it may matter,
/o at best gives you a very, very tiny performance gain
*, but can easily lead to incorrect code. As for the
/e, it's useless here as well. It tells the operator to not use the replacement directly, but to evaluate it as code. But the result of an expression consisting of a single variable is just the value of that variable anyway.
*There used to be a more significant speed up (which only matters if you execute the same regex repeatedly), but that speed up has been made largely redundant by regex improvements made long, long time ago (around the 5.003/5.004 era, IIRC).