Searching- an exact match
Searching- an exact match
When searching through a specific columns using a select - I don't want it to filter smartly.
If I search by code for example, and I look for '0 %', I don't want it to find all the '100 %' as well as all of the '50 %'.
oTable.columns(4).search(clusRegex, true);
where clusRegex looks something like (searchstring1 | searchstring2 | undefined) since I am using a multiselect, i need multiple searchstrings in.
What can I do to make it search for exact matches instead of partials?
This question has an accepted answers - jump to answer
Answers
I am really stuck here, does anyone what the arguments of the search functions have. And how I can tune them to only search for exact matches?
Use a little regex like in this example.
Allan
Thank you very much Allan, this was the thing I was missing.
.search( val ? '^'+val+'$' : '', true, false )