Regular Expression Match

Implement wildcard pattern matching with support for '?' and '*'.

'?' : Matches any single character.
'*' : Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).

Examples

str1 = "aa" & str2 = "a"result = 0
str1 = "aa" & str2 = "aa"result = 1
str1 = "aaa" & str2 = "aa")result = 0
str1 = "aa" & str2 = "*")result = 1
str1 = "aa" & str2 = "a*")result = 1
str1 = "ab" & str2 = "?*")result = 1
str1 = "aab" & str2 = "c*a*b")result = 0

Contributed by Murat Sütunç