Mark.js regex problems

Mark.js regex problems

YaniYani Posts: 24Questions: 7Answers: 0

I have some problems with mark.js where a regex search does not get highlighted.

dtApi.column('status:name').search('^test|test space$', true, false).draw();

The search works; only when the column matches "test" or "test space" the result is shown. However, because of the whole-line (^$) search, mark.js does not mark the results. When searching for test|test space it works, but I'd like to use the whole-line operators for the exact matches. Otherwise "test" also matches "test space".

I tried search('"test" "test space"', false, true); but that does not seem to be what I'm looking for. I also tried to change the mark() function in the datatables.mark.js plugin to markRegExp() but with the limited amount of time I have I couldn't get that to work either.

Wondering what I should do here and whether on not it's something that's supposed to work the way I'm using it.
I'm thinking of handling the marking myself as if it were a regular table on a page, but such workarounds I'd rather keep as a last resort.

Thanks.

Sign In or Register to comment.