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 jQuery DataTables - Filter column by an exact match which is not working for my case. My search string is a regular expression with | symbols which might look like s1|s2|s12. When the search string contains only s1 at that time s1 record is shown , but when i search multiple values s1|s2 then no records are shown
jQuery("#myTable").DataTable()
.columns("#")
.search("^"+'s1|s2'+"$",true,false)
.draw();
Result: No result found .
when i tried below code then addtional records are shown up
$('#myTable').DataTable().search('s1|s2').draw();
Result: s1,s2,s11,s14,s22,s25 etc.
Any help would be much appreciated ..