I need my regular expression to execute wether the incoming value is a string or an integer. What I have only works with strings. My Javascript is the following:
var regExp = new RegExp(valueToMatch, 'gi');
item.ssn.match(regExp)
The valueToMatch could be either a character that looks like "1" or 1. So basically a string or an integer.
valueToMatch?regExp.test(s), orregExp.test("" + s)- the string will get coerced to a string automatically.