鍍金池/ 問答/HTML/ sizzle的正則疑惑

sizzle的正則疑惑

對于一開始的兩個正則看不明白

    attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
        // Operator (capture 2)
        "*([*^$|!~]?=)" + whitespace +
        // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
        "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
        "*\\]",

    pseudos = ":(" + identifier + ")(?:\\((" +
        // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
        // 1. quoted (capture 3; capture 4 or capture 5)
        "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
        // 2. simple (capture 6)
        "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
        // 3. anything else (capture 2)
        ".*" +
        ")\\)|)",

想知道如何才算是attributes,pseudos ,
特別不理解的是其中匹配的 引號內(nèi) 斜杠加任意字符 如鏈接1里面的group3

鏈接打不上,Regulex
第一個的正則
\[(?:whitespace)*((?:identifier))(?:(?:whitespace)*([*^$|!~]?=)(?:whitespace)*(?:'((?:\\.|[^\\'])*)'|\"((?:\\.|[^\\\"])*)\"|((?:identifier)))|)(?:whitespace)*\]
第二個的正則
:((?:identifier)=)(?:\((('((?:\\.|[^\\'])*)'|\"((?:\\.|[^\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|(?:attributes))*)|.*)\)|)

回答
編輯回答