Handle * quantifier in regex patterns