testgen: minor: fixed a bug due to greedy quantifiers used in regex