Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Regular expression (with reserved characters) for filtering with OR selection

$
0
0
I am implementing an solution with Datatable. In this solution there's one column which contains values like: --, - , 0 , + and ++ . This is a representation of postive, neutral or negative values.

An custom filter should be added to filter this column on multiple values. For this I have created an multiple selection but I can't get the regular expression working.

For example: I want to filter al rows which contain the (exact matching) value + OR ++.

The examples/forum say that an OR can be created by using a regular expression. It should be something like:

var filter = '+|++'
oTable.fnFilter(filter, 2, true);

The + is a 'special character' in regular expressions so this has to be escaped in some kind of way. Normally it would be done by placing an \ but this doesn't work.

Could somebody give me some hints or help?

Viewing all articles
Browse latest Browse all 1816

Latest Images

Trending Articles



Latest Images