Sometimes we need to check that if a given string matches a format string or not. Look at the format string: (a)*(b)+(c)?(f|d), * represents the substring in the brackets before appears any times, if the format string is (ab)* ,then string “ababab” or null string match the format string .And + represents the substring in the brackets appears one or more times, for the format (ab)+ , the null string can’t match the format string. And the ? represents the substring in the brackets before appears none or once , and when you get the symbol |, either the substring s1(left of the symbol | ) appear once, or the substring s2(right of the symbol) appear once, but they don’t appear together. For example, (f|h) represent that either ‘f’ or ‘h’ appears for once.