diff --git a/src/nwsapi.js b/src/nwsapi.js index 7432c54..9057584 100644 --- a/src/nwsapi.js +++ b/src/nwsapi.js @@ -78,7 +78,7 @@ GROUPS = { // pseudo-classes requiring parameters linguistic: '(dir|lang)(?:\\x28\\s?([-\\w]{2,})\\s?(?:\\x29|$))', - logicalsel: '(is|where|matches|not|has)(?:\\x28\\s?(' + '[^()]*|.*' + ')\\s?(?:\\x29|$))', + logicalsel: '(is|where|matches|not|has)(?:\\x28\\s?(' + '[^()]*(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)[^()]*)*' + ')\\s?(?:\\x29|$))', treestruct: '(nth(?:-last)?(?:-child|-of\\-type))(?:\\x28\\s?(even|odd|(?:[-+]?\\d*)(?:n\\s?[-+]?\\s?\\d*)?)\\s?(?:\\x29|$))', // pseudo-classes not requiring parameters locationpc: '(any\\-link|link|visited|target|defined)\\b',