Fix a minor bug in regex matching.