Search Filter not handling special characters
Search Filter not handling special characters

I had a previous topic whereby I sought assistance in changing the search from a broad match to exact match:
https://datatables.net/forums/discussion/58173/filtering-columns-with-dropdown/
This worked fine to resolve the issue at hand BUT it has created another issue with a different column.
http://live.datatables.net/memajidi/7/edit
- The column "Advisor" will not filter at all - all filters return NULL - I believe this is related to the special characters () but I dont know enough about regex to be able to overcome this.
- The Dept column now filters with exact match BUT when I select "All" (which is an empty string - it no longer resets the column to display all rows - it removes everything and shows nothing.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Thanks for the example! You will want to look at this example and note the use of
$.fn.dataTable.util.escapeRegex()
:https://datatables.net/examples/api/multi_filter_select.html
The
(
and)
in the value are part of regex for capturing groups and other functions. You need to escape them to have them be part of the search string. Here is the updated example:http://live.datatables.net/reliwazo/1/edit
Kevin