Move solution regex function to separate util file.