Fix duplicate check regex

A pull request for #1739's regression. I've previously signed a CLA.