Checks if string matches the pattern.
Either matches('foo', /foo/i) or matches('foo', 'foo', 'i').
If given value is not a string, then it returns false.
Parameters
value: string
The value being checked.
pattern: RegExp
The match pattern
Optional modifiers: string
The modifiers
Returns boolean
True if string matches the pattern, false otherwise.
Checks if string matches the pattern. Either matches('foo', /foo/i) or matches('foo', 'foo', 'i'). If given value is not a string, then it returns false.