I am using RegExp to search text like below
RegExp(searchText, "gi").test(field)
It works fine with words.
But when i user special character like + OR * it gives me error like below
ERROR SyntaxError: Invalid regular expression: /*/: Nothing to repeat
Can anyone tell me what am i missing here?
I don't have much knowledge of RegExp
I don't want to escape these special characters. They should match/search with my field.
Duplicate question gives method to replace special characters. I want to allow special characters to match/search.