search with regular expression not working

search with regular expression not working

andytuandytu Posts: 4Questions: 2Answers: 0

Hi everyone:
I have a DataTable showing a list of accounting accounts, already filtered using $.fn.dataTableExt.afnFiltering(), and I want to perform a search to show(besides the previous filter) the ones that doesn't begin with 704(for example, 704, 7041, 7042, etc). I came across with a regular expression that allows me to select them, so, in order to do that, I do the following:

  table.search('^(?!704)\w+', true, false).draw();

But then, it shows me no rows. I also tried using $.fn.dataTable.util.escapeRegex() to escape the regular expression, but I got the same result.
Hope you can help me. Thanks in advance,
Andy

This discussion has been closed.