Given two strings, input_string and pattern_string, determine if pattern_string matches the entire input_string. The pattern_string may contain the special characters . (matches any single character) and * (matches zero or more of the preceding character). Return True if the pattern_string matches the entire input_string, otherwise return False.
Example 1
Input: input_string=abc, pattern_string=a.c
Output: True
Explanation: . matches b, so a.c matches abc.
Example 2
Input: input_string=aab, pattern_string=c*a*b
Output: True
Explanation: c* matches zero c, a* matches two a, b matches b.
Example 3
Input: input_string=miss, pattern_string=mis*
Output: True
Explanation: s* matches two s.
Example 4
Input: input_string=abcd, pattern_string=d*
Output: False
Explanation: Pattern d* does not match the entire string abcd.
Constraints
Case 1
Input: input_string='bba', pattern_string='b*a'
Expected: True
Case 2
Input: input_string='xyz', pattern_string='x.*z'
Expected: True
Case 3
Input: input_string='abc', pattern_string='ab*'
Expected: False
Case 4
Input: input_string='a', pattern_string='.*'
Expected: True
Case 5
Input: input_string='aaa', pattern_string='a*a'
Expected: True