Returns true when the pattern matches the input string.
Invalid patterns return false.
input string.
regular expression pattern.
true if matched.