Searching for the exact string (no substrings)

Searching for the exact string (no substrings)

playerspaceplayerspace Posts: 14Questions: 7Answers: 0
edited August 2016 in Free community support

Let's say i have a table with three rows. In one column, i have these vaules

1) coach
2) assistant coach
3) Coach

If i do a search now, all rows return. I don't want that. What I need is two sets of code to do the following operations:

1) to be able to type the word "coach" and only have it return rows 1 and 3.
2) to be able to type the word "coach" and only have it return row 1 (case sensitive)

Let me know if this is possible.

My current code is:

                var stringFilter = $(this).val();           
                var myregex = ("\\b" + stringFilter + "\\b");
                $("##add_grid").DataTable().column().columns(7).search(myregex,true,false).draw();
This discussion has been closed.