<athe literal text <a (case sensitive) \s+any whitespace character, repeated at least once
Comment: Look for '<a' followed by whitespace
?repeats the group contents below at most once:
Negated Character Class[^>]+ +matches at least one character outside the set below:
>the literal > (6210 / 768 / 3E16)
\s+any whitespace character, repeated at least once
Comment: Look for anything else that isn't 'href='
Comment: such as 'class=' or 'id='
hrefthe literal text href (case sensitive) \s*any whitespace character, repeated any number of times
=the literal = (6110 / 758 / 3D16)
\s*any whitespace character, repeated any number of times
Comment: locate the 'href=' with any whitespace around the '=' character
Group 2(
'([^']*)' # Look for '...'
| # ...or...
"([^"]*) # Look for "..."
| # ...or...
([^\s>]+) # Look anything NOT '>' or spaces
) 1st Alternative
'([^']*)' # Look for '...'
'the literal text '
Negated Character Class[^']* *matches any number of characters outside the set below:
'the literal ' (3910 / 478 / 2716)
Comment: Look for '...'
2nd Alternative # ...or...
"([^"]*) # Look for "..."
Comment: ...or...
"the literal text "
Negated Character Class[^"]* *matches any number of characters outside the set below:
"the literal " (3410 / 428 / 2216)
Comment: Look for "..."
3rd Alternative # ...or...
([^\s>]+) # Look anything NOT '>' or spaces
Comment: ...or...
Negated Character Class[^\s>]+ +matches at least one character outside the set below:
\sany whitespace character
>the literal > (6210 / 768 / 3E16)
Comment: Look anything NOT '>' or spaces
Negated Character Class[^>]* *matches any number of characters outside the set below:
>the literal > (6210 / 768 / 3E16)
Comment: Match anything else up to the closing '>'
g modifier: global. Finds all matches instead of stopping after the first
x modifier: extended. Ignores unescaped whitespace and comments outside character classes
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string