Microsoft interview question

Match the regex pattern to a string and return true or false if the string fits the pattern. (Leetcode #10)