Ticket #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: | |
| Blocking: | Blocked by: |
Description
A regex attribute filter that might be very useful for xml data search. Done with little ATTR: match and filter update.
Diff attached.
Attachments
Change History
comment:2 Changed 4 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 4 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 :
$('input[name/=/f
w{2}
[
w*
]/i]') works because it contains
] which avoid a chunk/match error (not found where it is buggy yet)
$('input[name/=/f
w{2}
[
w*/i]') doesn't work...
I'm trying to find a fix for this.
comment:4 Changed 4 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.
comment:5 Changed 3 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 3 years ago by snover
- Keywords needsreview added
- Priority changed from minor to low
- Version changed from 1.3 to 1.4.3
- Milestone 1.3.1 deleted
Bikeshed/feature creep
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


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