Factor out common string-cleaning

Moves the regex string for removing non-alphanumeric characters into its
own utility method.