I am facing a problem in matching a substring with a String. My substring and string are something like
var str="My name is foo.I have bag(s)"
var substr="I have bag(s)"
now when I use str.match(substr) it returns null probably because match() function takes input as a regex and in my case it gets confused with the '('. I tried using '\'before round brackets but it didn't worked. indexOf() function is working but I am not allowed to use that. I also used test() and exec() but without any success