Change regex
Change regex
dfigueira
Posts: 15Questions: 3Answers: 0
Hi guy's,
I'm using the column filter. Trouble is that when I am searching for phrases that include "(", it will fail the search. How can I ignore this on the regex, considering I am already matching the whole word?
table.column(colIdx).search("^" + searchString + "$", true, false).data().draw();
Thank you
This discussion has been closed.
Answers
You will probably want to use the escapeRegex function to use the `(`` as part of the search and not a regex special character:
https://datatables.net/reference/api/%24.fn.dataTable.util.escapeRegex()
Kevin
Well, I did it. Added a regex, ignoring the "|" to add the multiple values on the search string of each column. But now I am having a new problem, when searching for values that have html around it. Any idea how I can skip this or I would have to revogue the html?
Can you provide examples of what you are trying to search?
Kevin
In some places are like that - labels. Other places is direct text without any spans around them.