Non-Capturing Group(?:<!DOCTYPE html>\s*)? ?repeats the group contents below at most once:
<!DOCTYPE html>the literal text <!DOCTYPE html> (case insensitive) \s*any whitespace character, repeated any number of times
<htmlthe literal text <html (case insensitive) Negated Character Class[^>]*? *?matches any number of characters outside the set below:
>the literal > (6210 / 768 / 3E16)
>the literal > (6210 / 768 / 3E16)
\s*any whitespace character, repeated any number of times
<head>the literal text <head> (case insensitive) *?matches any number of characters from the set below:
\sany whitespace character
\Sany non-whitespace character
<the literal < (6010 / 748 / 3C16)
\/the literal / (4710 / 578 / 2F16)
head>the literal text head> (case insensitive) \s*any whitespace character, repeated any number of times
<bodythe literal text <body (case insensitive) Negated Character Class[^>]*? *?matches any number of characters outside the set below:
>the literal > (6210 / 768 / 3E16)
>the literal > (6210 / 768 / 3E16)
Group body(?<body>[\s\S]*?) *?matches any number of characters from the set below:
\sany whitespace character
\Sany non-whitespace character
<the literal < (6010 / 748 / 3C16)
\/the literal / (4710 / 578 / 2F16)
body>the literal text body> (case insensitive) \s*any whitespace character, repeated any number of times
Non-Capturing Group(?:<\/html>)? ?repeats the group contents below at most once:
<the literal < (6010 / 748 / 3C16)
\/the literal / (4710 / 578 / 2F16)
html>the literal text html> (case insensitive)