Solved the regular expression matching problem incorrectly because of incorrect understanding of meaning of wildcard character '*', solved another different matching problem instead.