The pattern matching methods in the RegExp object require String objects
Pattern Matching Methods in the RegExp Object MethodDescription exec(str)Searches for pattern in str and returns result test(str)Searches for pattern in str and returns true if match found, otherwise false is returned (str)Same as exec(str) method