/matches

Tests whether `value` matches `regexp` (a value that will be converted to a `RegExp` object if necessary).

Primary LanguageJavaScript

matches

Test whether an arbitrary value (converted to a RegExp object if necessary) regexp matches a (possibly coerced) string value.