Don't duplicate matches and prefer matches from the start of the string