Noob fnFilter regex question

Noob fnFilter regex question

jdbjdb Posts: 9Questions: 0Answers: 0
edited January 2011 in General
Suppose I've got a hidden 6th column in oTable with:
[code]
color red
size small
color white
size medium
color blue
size large
color green
size x-large
[/code]
So far I have successfully done this:
[code]
oTable.fnFilter('color',5,true,true,false);
[/code]
to get this:
[code]
color red
color white
color blue
color green
[/code]
Before I dig into the absolutely baffling syntax of regular expressions I need someone more experienced than I to tell me whether I'm wasting my time trying to craft an expression to do something like this:

"color" but not "red" AND not "blue" (return all the "color" but then filter out the "red" and the "blue" from them)

so I end up with just this:
[code]
color white
color green
[/code]

Replies

  • jdbjdb Posts: 9Questions: 0Answers: 0
    edited January 2011
    Google was my friend once again:

    [code]^(?=.*color)(?!.*(?:red|blue))[/code]
This discussion has been closed.