/
^
(?P<group>
(?P<structured>
(?P<single>
(?P<tag_first>
(?P<tag>
\d+(?:\/\d+)+
|
(?P<repnum>\$+(?:@\^*-?\d*)?)
|
[\w:!-]
)++
(?P<attr>
(?P<short_attr>
\.
(?P<short_val>
(?P>repnum)
|
[\w:!-]
)*
|
\#(?P>short_val)*
)
|
(?P<long_attr>
\[
(?P<attr_pair>
(?P<attr_name>
\\(?:\\{2})*["'\s]
|
[^\[\]"'\s\\]
)+
\.?
(?P<equal_val>
=
(?P<attr_val>
(?P<unquoted_val>
\\(?:\\{2})*[\[\]"'\s]
|
[^\[\]"'\s\\]
)+
|
(?P<quoted_val>
(?P<quote>["'])
(?: