If someone has seen this question before, please link, perhaps I am searching the wrong things. I get nothing but results for parsing css files. Basically, I have an array of selectors, something like
[".thislink", "#myid"]
.
I'm looking to pass any string selector formatted like css3 selectors, ex:
a.thislink:not(.ignore)[href^=http://]
into a .match and split it out into an array of selectors, ideally:
[a, .thislink, :not(.ignore), [href^=http://]]
that I can loop through. I would then use that same breakdown on any :not() selectors to get a second array of "not", which I can match against my original array of individual selectors.
Tag, class, ID, attr, and :not selectors should be all I need. I can figure out how to break down the [attr=val]
and :not(selectorshere)
myself, I think.
PS: I know it would be easy to match my original array values in the string selector, however, I don't actually have an array of selectors. It would take several paragraphs to explain why exactly I'm doing it this way, so just trust me, I can't do it =)