-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assert::alpha() only works with Latin characters #98
Comments
Confirmed, but should the validation also pass with Chinese characters and be independent of the active locale? As this will going to happen after the suggested change? |
Thank you for opening this issue. Currently, the locale is 'forced', so the If this new assertion gets added, what do you think it should be named? I'd also like to point out that the regex you linked may not work as intended: https://3v4l.org/7M1LZ |
Ah, the regex will need the The name |
Guess i missed that, it does look more promising now. I think this fits a common enough use case to add this to the libary, so feel free to open a PR. |
Because of the reliance on
ctype_alpha
, in most locales Unicode characters will be rejected, despite being very common in strings that you might want to check only contain letters.It would be great to see a new assertion that accepts common letters like Å or Ö. Perhaps using the regex
/^\p{L}*$/
would be most appropriate?\p{L}
will match any valid Unicode letters, in either case.The text was updated successfully, but these errors were encountered: