ng2-table
ng2-table copied to clipboard
Filtering (Regex) broken, after Wildcard (e.g. ?, *, ...)
After inputting an asterisk (*) or a questionmark (?) at the beginning of a filter-input-field, the regex gets broken.
An Error occurs in "core.umd.js":
core.umd.js:3427 EXCEPTION: Invalid regular expression: /*/: Nothing to repeat
Could you please fix this?
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, '\\$&');
}
https://github.com/valor-software/ng2-table/issues/412
@wOOx92 , here you can see solution.