<the literal < (6010 / 748 / 3C16)
\?the literal ? (6310 / 778 / 3F16)
Comment: opening tag
Negated Character Class[^?\/]* *matches any number of characters outside the set below:
?the literal ? (6310 / 778 / 3F16)
\/the literal / (4710 / 578 / 2F16)
Comment: all that is not a ? or a /
Non-Capturing Group(?:
\/ # a slash:
(?:
(?![\/*]) [^?\/]* # - not followed by a slash or a *
|
\/.*(?:\n[^?\/]*)? # - that starts a single line comment
|
\* # - that starts a multiline comment
[^*]* (?:\*+(?!\/)[^*]*)* # (comment content)
(?:\*\/ [^?\/]* | $) # */ is optional
)
|
\?(?!>) [^?\/]* # a ? not followed by a >
)* *repeats the group contents below any number of times:
1st Alternative
\/ # a slash:
(?:
(?![\/*]) [^?\/]* # - not followed by a slash or a *
|
\/.*(?:\n[^?\/]*)? # - that starts a single line comment
|
\* # - that starts a multiline comment
[^*]* (?:\*+(?!\/)[^*]*)* # (comment content)
(?:\*\/ [^?\/]* | $) # */ is optional
)
\/the literal / (4710 / 578 / 2F16)
Comment: a slash:
Non-Capturing Group(?:
(?![\/*]) [^?\/]* # - not followed by a slash or a *
|
\/.*(?:\n[^?\/]*)? # - that starts a single line comment
|
\* # - that starts a multiline comment
[^*]* (?:\*+(?!\/)[^*]*)* # (comment content)
(?:\*\/ [^?\/]* | $) # */ is optional
) 1st Alternative
(?![\/*]) [^?\/]* # - not followed by a slash or a *
Negative Lookahead(?![\/*]) \/the literal / (4710 / 578 / 2F16)
*the literal * (4210 / 528 / 2A16)
Negated Character Class[^?\/]* *matches any number of characters outside the set below:
?the literal ? (6310 / 778 / 3F16)
\/the literal / (4710 / 578 / 2F16)
Comment: - not followed by a slash or a *
2nd Alternative
\/.*(?:\n[^?\/]*)? # - that starts a single line comment
\/the literal / (4710 / 578 / 2F16)
.*any character (except for line terminators), repeated any number of times
Non-Capturing Group(?:\n[^?\/]*)? ?repeats the group contents below at most once:
\na line-feed (newline) character (ASCII 10)
Negated Character Class[^?\/]* *matches any number of characters outside the set below:
?the literal ? (6310 / 778 / 3F16)
\/the literal / (4710 / 578 / 2F16)
Comment: - that starts a single line comment
3rd Alternative
\* # - that starts a multiline comment
[^*]* (?:\*+(?!\/)[^*]*)* # (comment content)
(?:\*\/ [^?\/]* | $) # */ is optional
\*the literal * (4210 / 528 / 2A16)
Comment: - that starts a multiline comment
Negated Character Class[^*]* *matches any number of characters outside the set below:
*the literal * (4210 / 528 / 2A16)
Non-Capturing Group(?:\*+(?!\/)[^*]*)* *repeats the group contents below any number of times:
\*+the literal * (4210 / 528 / 2A16) , repeated at least once
\/the literal / (4710 / 578 / 2F16)
Negated Character Class[^*]* *matches any number of characters outside the set below:
*the literal * (4210 / 528 / 2A16)
Comment: (comment content)
Non-Capturing Group(?:\*\/ [^?\/]* | $) 1st Alternative\*\/ [^?\/]* \*the literal * (4210 / 528 / 2A16)
\/the literal / (4710 / 578 / 2F16)
Negated Character Class[^?\/]* *matches any number of characters outside the set below:
?the literal ? (6310 / 778 / 3F16)
\/the literal / (4710 / 578 / 2F16)
$end of string, or before its final line terminator
Comment: */ is optional
2nd Alternative
\?(?!>) [^?\/]* # a ? not followed by a >
\?the literal ? (6310 / 778 / 3F16)
>the literal > (6210 / 768 / 3E16)
Negated Character Class[^?\/]* *matches any number of characters outside the set below:
?the literal ? (6310 / 778 / 3F16)
\/the literal / (4710 / 578 / 2F16)
Comment: a ? not followed by a >
Non-Capturing Group(?:\?>|$) \?the literal ? (6310 / 778 / 3F16)
>the literal > (6210 / 768 / 3E16)
Comment: optional closing tag ?>
g modifier: global. Finds all matches instead of stopping after the first
x modifier: extended. Ignores unescaped whitespace and comments outside character classes