@
(?(DEFINE)
(?<next_open_tag>
[^<]*+
(?i: <++[^<?s][^<]*
| <++(?! \?php
| \?=
| script\s*language\s*=\s*([\'"]?)php\g{-1}\s*>
) [^<]*
)*+
(?i: <++(?: \?php
| \?=
| [^>]+
)
| \z
)
)
)
\A (?&next_open_tag) \K
|
[^'"`/#<?]*+
(?: '(?:[^'\\]+|\\.)*+' [^\'"`/#<?]*
| "(?:[^"\\]+|\\.)*+" [^\'"`/#<?]*
| `(?:[^`\\]+|\\.)*+` [^\'"`/#<?]*
| /(?![/*]) [^\'"`/#<?]* # stop for // or