Skip to content

Fix: Update Email Validation Regex for Improved Accuracy#62

Merged
0xHexE merged 1 commit intomadari-media:mainfrom
yxx4c:fix/email-regex-validation
Mar 3, 2025
Merged

Fix: Update Email Validation Regex for Improved Accuracy#62
0xHexE merged 1 commit intomadari-media:mainfrom
yxx4c:fix/email-regex-validation

Conversation

@yxx4c
Copy link
Contributor

@yxx4c yxx4c commented Mar 2, 2025

This pull request updates the email validation regex in the authentication pages to improve accuracy and support a broader range of valid email formats. The previous regex was restrictive and did not allow for some valid email addresses. The updated regex is more permissive and adheres to standard email formatting rules.

Changes:

  1. Updated Regex:

    • Old Regex: r'^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$'
    • New Regex: r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
  2. Files Modified:

    • lib/features/auth/pages/forget_password_page.dart
    • lib/features/auth/pages/signin_page.dart
    • lib/features/auth/pages/signup_page.dart

Benefits:

  • Improved accuracy in email validation.
  • Supports a wider range of valid email formats.
  • Enhances user experience by allowing more users to successfully register and sign in.

Testing:

  • Ensure that the updated regex does not falsely reject valid email addresses.
  • Verify that the regex correctly identifies invalid email formats.
  • Test the authentication flow with various email formats to confirm the changes.

Reviewers:

  • Please assign this PR to a reviewer with expertise in authentication and regex validation.

Checklist:

  • Code review completed.
  • Unit tests passed.
  • Integration tests passed.
  • Manual testing completed.

Thank you for your review and approval!

@0xHexE
Copy link
Contributor

0xHexE commented Mar 3, 2025

Thank you!

@0xHexE 0xHexE merged commit 9397b17 into madari-media:main Mar 3, 2025
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants