Regular expression splitting multiple queries
Multiple CSS selectors can be present within the same query like this: div>a, div>li>a
, and a simple explode()
was being called to split the strings. However, this caused an issue when one selector was looking for an attribute selector whose value contained a comma.
To solve this, a regular expression has been used to split only commas that are not surrounded by quotes.