The string against which to match the regular expression.
The text of the regular expression.
Optional
flags: stringRegular expression flags, such as global and case-insensitive searches. The default is none (undefined).
true if there is a match between the regular expression and the string str. Otherwise, false.
Returns true if the given str matches the given regex.