Yeah, it's a bit awkward ... I'm not 100% sure that regexes in DW follow all the rules seamlessly.
Also, I'm not an expert on regexes 🙁 so someone else might have a simpler solution, but ...
<\?php([?]\?[>]){1,1}[?]*\?>
... seems to work ok.
If you can guarantee that there isn't a ? between the php
tags, then it'd be a whole lot simpler.
Incidentally, I first tried ...
<\?php([?]\?[>])[?]*\?>
... which should, I think, be exactly equivalent, but it fails if there are questions marks in the php code. Maybe someone else knows why.
Paul.
PS Remember not to 'match case'.