Searching- an exact match

Searching- an exact match

SoreboSorebo Posts: 6Questions: 3Answers: 0

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

  • SoreboSorebo Posts: 6Questions: 3Answers: 0

    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?

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Answer ✓

    Use a little regex like in this example.

    Allan

  • SoreboSorebo Posts: 6Questions: 3Answers: 0

    Thank you very much Allan, this was the thing I was missing.

    .search( val ? '^'+val+'$' : '', true, false )

This discussion has been closed.