I've got a regex...
internal static readonly Regex _parseSelector = new Regex(@"
(?<tag>" + _namePattern + @")?
(?:\.(?<class>" + _namePattern + @"))*
(?:\#(?<id>" + _namePattern + @"))*
(?<attr>\[\s*
(?<name>" + _namePattern + @")\s*
(?:
(?<op>[|*~$!^%<>]?=|[<>])\s*
(?<quote>['""]?)
(?<value>.*?)
(?<!\\)\k<quote>\s*
)?
\])*
(?::(?<pseudo>" + _namePattern + @"))*
", RegexOptions.IgnorePatternWhitespace);
For which I grab the match object...
var m = _parseSelector.Match("tag.class1.class2#id[attr1=val1][attr2=\"val2\"][attr3]:pseudo");
Now is there a way to do something akin to m.Group["attr"]["name"]
? Or somehow get the groups inside the attr group?