How to create a regex for the OR condition <TableName> dataTable (). Fnfilter

Getting a hard time creating a regular expression for an OR condition.

Example: a table has 2 columns and is trying to load into the 2nd column (let’s say it is a status column) and a regular search expression:

//javascript $('#filter-status').change(function() { searchTxt = "Not Shared|Private"; <table name>.dataTable().fnFilter(searchTxt , 2,true); } 

It looks like it pulls data using "Not Shared", since the status bu does not pull data with the status "Private".

Even tried with searchTxt like "^ (not shared) | (private) $" and "/ (^ Not Shared $) | (^ Private $) /"

Not sure what I am missing. Can anyone help?

+4
source share
1 answer

Found that this is not a regex problem. But jQuery dataTable (). FnFilter smartsearch. I just needed to make the 4th argument false , and it worked.

 <table name>.dataTable().fnFilter(searchTxt, 2, true, false); 
+6
source

All Articles