change emailRegex to emailPattern