I'm trying to build a pattern for a multiline string, that must start with <?php or whitespace + <?php and NOT end with ?> or ?> + whitespace.
My attempt was /^\s?<\?php.*[^>]\s?$/s but it did not work. Also tried the negative lookahead - no use.
Any idea? Thanks in advance.