ng2-table
ng2-table copied to clipboard
Invalid regular expression: /?/
Hello, there is a tiny bug in filtering function. If you write in field "Filter all columns" just "?" in console you get
EXCEPTION: Invalid regular expression: /?/: Nothing to repeat
and it crashes the application.
I also noticed that filtering by some special characters breaks the application. My workaround was to escape the special characters in all filter strings using a function:
private escapeSpecialCharacters(inputText: string) {
return inputText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}