Bug Tracker

Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#3951 closed enhancement (invalid)

New /= regex filter

Reported by: shazam Owned by: john
Priority: low Milestone:
Component: selector Version: 1.4.3
Keywords: regex filter Cc:
Blocked by: Blocking:


A regex attribute filter that might be very useful for xml data search. Done with little ATTR: match and filter update.

Diff attached.

Attachments (1)

regex selector.diff (1.3 KB) - added by shazam 14 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 years ago by shazam

Sample :

$('book[author/=/moli[èe]re/i]') will match every book written by Moliere or Molière ignoring case.

comment:2 Changed 14 years ago by shazam

This new feature doesn't break any test and supports almost all regexp.

I did plenty of tests and it seems that only expressions like : $('input[name/=/foo
[bar\]/]') trying to match <input name="foo[bar]"/> doesn't work properly around the escaped

comment:3 Changed 14 years ago by shazam

After some more testing it appears that the problem is on expressions containing an opened
[ that is not closed. for example :

]/i]') works because it contains
] which avoid a chunk/match error (not found where it is buggy yet)

w*/i]') doesn't work...

I'm trying to find a fix for this.

comment:4 Changed 14 years ago by shazam

Ok managed to make it work properly but i had to change the chunker regex.

I tested many regex including special chars - [](){}. - escaped or not backreferences.... everything works properly and more it does not break any test in the test suite.

Diff attached.

Changed 14 years ago by shazam

Attachment: regex selector.diff added

comment:5 Changed 13 years ago by dmethvin

Since Sizzle now uses querySelectorAll, any enhancement that introduces non-standard selector syntax is likely to throw warnings in the console. It happens for pseudos like :hidden and seems to be a concern when people see it, so I'd be wary of introducing features like this.

comment:6 Changed 12 years ago by snover

Keywords: needsreview added
Milestone: 1.3.1
Priority: minorlow

Bikeshed/feature creep

comment:7 Changed 12 years ago by dmethvin

Resolution: invalid
Status: newclosed

In order to use native querySelectorAll in more cases, we need to avoid non-standard extensions to the CSS query syntax.

comment:8 Changed 12 years ago by dmethvin

Keywords: needsreview removed
Note: See TracTickets for help on using tickets.