I want to search the specific column data of datatables with exact match but my regular expression is not working properly. I want it to work with the word dot word i.e. Jhon.smith but It also works with only one word i.e. the result comes on entering "Jhon" only. Please can you help me with suggested it would be very appreciated.
initComplete: function () {
// Apply the search
this.api().columns(8).every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change clear', function () {
if ( that.search() !== this.value ) {
var searchTerm = this.value.toLowerCase(),
regex = '\\b' + searchTerm + '\\b';
that
.search( regex, true, false )
.draw();
}
} );
} );
}
With Many thanks