Merge pull request #62 from yxx4c/fix/email-regex-validation
Some checks failed
Build and Deploy / build_windows (push) Has been cancelled
Build and Deploy / build_android (push) Has been cancelled
Build and Deploy / build_ipa (push) Has been cancelled
Build and Deploy / build_linux (push) Has been cancelled
Build and Deploy / build_macos (push) Has been cancelled

Fix: Update Email Validation Regex for Improved Accuracy
This commit is contained in:
Horizon 2025-03-03 10:56:10 +05:30 committed by GitHub
commit 9397b17e42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -54,7 +54,7 @@ class _ForgotPasswordPageState extends State<ForgotPasswordPage> {
if (value?.isEmpty ?? true) {
return 'Please enter your email';
}
if (!RegExp(r'^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(value!)) {
if (!RegExp(r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$').hasMatch(value!)) {
return 'Please enter a valid email';
}
return null;

View file

@ -278,7 +278,7 @@ class _SignInPageState extends State<SignInPage>
return 'Please enter your email';
}
if (!RegExp(
r'^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$')
r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$')
.hasMatch(value!)) {
return 'Please enter a valid email';
}

View file

@ -320,7 +320,7 @@ class _SignUpPageState extends State<SignUpPage>
return 'Please enter your email';
}
if (!RegExp(
r'^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$')
r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$')
.hasMatch(value!)) {
return 'Please enter a valid email';
}