attributeMatches method
Require that matched nodes have attribute attr with a value matching pattern.
Implementation
TagQuery attributeMatches(String attr, RegExp pattern) {
// require attribute
hasAttribute(attr);
// and require value ~= pattern
return where((n) => pattern.hasMatch(n.attributes[attr]!));
}