DataTables column search for exact match

Viewed 6559

I am using jQuery DataTables plugin in my application. I am trying to search for a string that exactly matches the data in a column.

I checked the this topic and its solution is not working for my case. My search string is a regular expression with | symbols which might look like Logged In|Active|Not Active.

When the search string contains Active(Logged In|Active), records with Not Active are also showing up when I use the following search:

jQuery("#myTable").DataTable()
                .columns("#status")
                .search("^"+status+"$",true,false)
                .draw();
 

Any help is appreciated. Thanks in advance!

3 Answers
Related