Finished regular expression matching problem.