Comment: Это блок с объявлением функций
Comment: Этот блок - единственное место, где нужно подставлять значения
Group tagName(?<tagName>ul) ulthe literal text ul (case insensitive) Comment: Имя тега
Group attrName(?<attrName>class) classthe literal text class (case insensitive) Comment: Атрибут тега
Group attrValue(?<attrValue>ul) ulthe literal text ul (case insensitive) Comment: Значение тега
Group anyAttrName(?<anyAttrName>[^\s\>\=]*+) Negated Character Class[^\s\>\=]*+ *+matches any number of characters outside the set below:
\sa Unicode whitespace character
\>the literal > (6210 / 768 / 3E16)
\=the literal = (6110 / 758 / 3D16)
Comment: Любое название атрибута
Group anyAttrValue(?<anyAttrValue>\"[^\"]*+\"|\'[^\']*+\'|\`[^\']*+\`|[^\s\>]*+) 1st Alternative\"[^\"]*+\" \"the literal " (3410 / 428 / 2216)
Negated Character Class[^\"]*+ *+matches any number of characters outside the set below:
\"the literal " (3410 / 428 / 2216)
\"the literal " (3410 / 428 / 2216)
2nd Alternative\'[^\']*+\' \'the literal ' (3910 / 478 / 2716)
Negated Character Class[^\']*+ *+matches any number of characters outside the set below:
\'the literal ' (3910 / 478 / 2716)
\'the literal ' (3910 / 478 / 2716)
3rd Alternative\`[^\']*+\` \`the literal ` (9610 / 1408 / 6016)
Negated Character Class[^\']*+ *+matches any number of characters outside the set below:
\'the literal ' (3910 / 478 / 2716)
\`the literal ` (9610 / 1408 / 6016)
Negated Character Class[^\s\>]*+ *+matches any number of characters outside the set below:
\sa Unicode whitespace character
\>the literal > (6210 / 768 / 3E16)
Comment: Любое значение атрибута
Group anyAttr(?<anyAttr>(?&anyAttrName)\s*+(?:\=\s*+(?&anyAttrValue)\s*+)?+) (?&anyAttrName)calls group anyAttrName as a subroutine
\s*+a Unicode whitespace character, repeated any number of times
Non-Capturing Group(?:\=\s*+(?&anyAttrValue)\s*+)?+ ?+repeats the group contents below at most once:
\=the literal = (6110 / 758 / 3D16)
\s*+a Unicode whitespace character, repeated any number of times
(?&anyAttrValue)calls group anyAttrValue as a subroutine
\s*+a Unicode whitespace character, repeated any number of times
Comment: Любой атрибут
Comment: Если нужно найти точное вхождение значения атрибута
Group attr(?<attr>
(?&attrName)\b\s*+\=\s*+ #Нужное нам название атрибута
(?: #Поиск точного вхождения
\"(?&attrValue)\"|
\'(?&attrValue)\'|
\`(?&attrValue)\`|
(?&attrValue)(?=[\s\>])
)
) (?&attrName)calls group attrName as a subroutine
\ba Unicode word boundary
\s*+a Unicode whitespace character, repeated any number of times
\=the literal = (6110 / 758 / 3D16)
\s*+a Unicode whitespace character, repeated any number of times
Comment: Нужное нам название атрибута
Non-Capturing Group(?: #Поиск точного вхождения
\"(?&attrValue)\"|
\'(?&attrValue)\'|
\`(?&attrValue)\`|
(?&attrValue)(?=[\s\>])
) 1st Alternative #Поиск точного вхождения
\"(?&attrValue)\" Comment: Поиск точного вхождения
\"the literal " (3410 / 428 / 2216)
(?&attrValue)calls group attrValue as a subroutine
\"the literal " (3410 / 428 / 2216)
2nd Alternative
\'(?&attrValue)\' \'the literal ' (3910 / 478 / 2716)
(?&attrValue)calls group attrValue as a subroutine
\'the literal ' (3910 / 478 / 2716)
3rd Alternative
\`(?&attrValue)\` \`the literal ` (9610 / 1408 / 6016)
(?&attrValue)calls group attrValue as a subroutine
\`the literal ` (9610 / 1408 / 6016)
4th Alternative
(?&attrValue)(?=[\s\>])
(?&attrValue)calls group attrValue as a subroutine
Positive Lookahead(?=[\s\>]) \sa Unicode whitespace character
\>the literal > (6210 / 768 / 3E16)
Comment: Если нужно искать в атрибуте значение как в классах
Group attrClass(?<attrClass>
(?&attrName)\b\s*+\=\s*+ #Нужное нам название атрибута
(?: #Поиск значения как в классах
\"[^\"]*?\b(?&attrValue)\b[^\"]*+\"|
\'[^\']*?\b(?&attrValue)\b[^\']*+\'|
\`[^\`]*?\b(?&attrValue)\b[^\`]*+\`|
(?&attrValue)(?=[\s\>])
)
) Comment: В зависимости от того, какую из 2 функций выше мы хотим использовать для проверки атрибута
Comment: Строгое сравнение значения
Group tag(?<tag>\<(?&tagName)\b\s*+(?&anyAttr)*?(?&attr)(?&anyAttr)*?\>) Comment: Использовать так: (?&tag)
Comment: Поиск значения как в классах
Group tagClass(?<tagClass>\<(?&tagName)\b\s*+(?&anyAttr)*?(?&attrClass)(?&anyAttr)*?\>) Comment: Использовать так: (?&tagClass)