Added support for (basic) nested parens and (basic) nested brackets. You can now...
[jquery.git] / src / selector / selector.js
index d9114c2..e21102c 100644 (file)
@@ -70,10 +70,10 @@ jQuery.extend({
                "\\[ *(@)S *([!*$^=]*) *('?\"?)(.*?)\\4 *\\]",
 
                // Match: [div], [div p]
-               "(\\[)\\s*(.*?)\\s*\\]",
+               "(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]",
 
                // Match: :contains('foo')
-               "(:)S\\(\"?'?([^\\)]*?)\"?'?\\)",
+               "(:)S\\(\"?'?(.*?(\\(.*?\\))?[^(]*?)\"?'?\\)",
 
                // Match: :even, :last-chlid
                "([:.#]*)S"