Skip to main content

Bug Tracker

Side navigation

#3951 closed enhancement (invalid)

Opened January 22, 2009 12:01PM UTC

Closed November 02, 2010 01:21AM UTC

Last modified November 02, 2010 01:58AM UTC

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:
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 (1)
Change History (8)

Changed January 22, 2009 12:07PM UTC by shazam comment:1

Sample :

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

Changed January 22, 2009 06:10PM UTC by shazam comment:2

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 \\\\[

Changed January 23, 2009 10:26AM UTC by shazam comment:3

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.

Changed January 23, 2009 01:02PM UTC by shazam comment:4

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 July 26, 2010 12:58AM UTC by dmethvin comment:5

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.

Changed October 31, 2010 01:31AM UTC by snover comment:6

keywords: regex filterregex filter needsreview
milestone: 1.3.1
priority: minorlow
version: 1.31.4.3

Bikeshed/feature creep

Changed November 02, 2010 01:21AM UTC by dmethvin comment:7

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.

Changed November 02, 2010 01:58AM UTC by dmethvin comment:8

keywords: regex filter needsreviewregex filter