(?xi)applies the following effective flags to the remainder of the pattern: gxi x modifier: extended. Ignores unescaped whitespace and comments outside character classes
i modifier: insensitive. Matches without distinguishing uppercase and lowercase letters
Comment: i-flag for caseless, x-flag for comments (free spacing mode)
Comment: 1.) match <select with optional space at the end
\s*any whitespace character, repeated any number of times
selectthe literal text select (case insensitive) \sany whitespace character
Negated Character Class[^>]*? *?matches any number of characters outside the set below:
>the literal > (6210 / 768 / 3E16)
\ban ASCII word boundary
namethe literal text name (case insensitive) \s*any whitespace character, repeated any number of times
=the literal = (6110 / 758 / 3D16)
\s*any whitespace character, repeated any number of times
"the literal " (3410 / 428 / 2216)
'the literal ' (3910 / 478 / 2716)
\s*any whitespace character, repeated any number of times
quantitythe literal text quantity (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
Comment: 2.) match lazily any amount of options until the "selected"
Non-Capturing Group(?:<\s*option[^>]*>\s*)*? *?repeats the group contents below any number of times:
<the literal < (6010 / 748 / 3C16)
\s*any whitespace character, repeated any number of times
optionthe literal text option (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
Comment: 3.) match selected using a lookahead and capture number from value
\s*any whitespace character, repeated any number of times
optionthe literal text option (case insensitive) \sany whitespace character
Positive Lookahead(?=[^>]*?\bselected) Negated Character Class[^>]*? *?matches any number of characters outside the set below:
>the literal > (6210 / 768 / 3E16)
\ban ASCII word boundary
selectedthe literal text selected (case insensitive) Negated Character Class[^>]*? *?matches any number of characters outside the set below:
>the literal > (6210 / 768 / 3E16)
\ban ASCII word boundary
valuethe literal text value (case insensitive) \s*any whitespace character, repeated any number of times
=the literal = (6110 / 758 / 3D16)
\s*any whitespace character, repeated any number of times
"the literal " (3410 / 428 / 2216)
'the literal ' (3910 / 478 / 2716)
\s*any whitespace character, repeated any number of times
\da digit
*matches any number of characters from the set below:
.the literal . (4610 / 568 / 2E16)
,the literal , (4410 / 548 / 2C16)
\da digit
g modifier: global. Finds all matches instead of stopping after the first