You are given a text s and a pattern p. Decide whether the pattern matches the whole text. The pattern can use two special characters:
. matches any single character.
* matches zero or more copies of the character just before it.
The pattern must match the entire text, not just a part of it. Return true or false.
Examples
Example 1:
Input: s = "abc", p = "a.c"
Output: true
Explanation: The dot can stand for b.
Example 2:
Input: s = "baaa", p = "ba*"
Output: true
Explanation: The pattern is b followed by any number of a. It matches b followed by three a.
Example 3:
Input: s = "abcd", p = "abc"
Output: false
Explanation: The pattern matches only the first three letters, not the whole text.