Skip to content

Update regex of email validation#682

Merged
AlaaElattar merged 4 commits into
developmentfrom
development_fix_email_validation
Nov 21, 2024
Merged

Update regex of email validation#682
AlaaElattar merged 4 commits into
developmentfrom
development_fix_email_validation

Conversation

@AlaaElattar
Copy link
Copy Markdown
Contributor

@AlaaElattar AlaaElattar commented Oct 30, 2024

Tested Scenarios:

All the following cases will be rejected by regex:

  • aa@aa
  • user..name@gmail.com
  • username@domain-.com
  • username@-domain.com
  • .user@gmail.com
  • user.@gmail.com

Copy link
Copy Markdown
Contributor

@zaelgohary zaelgohary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex accepts the following invalid scenarios:

  • Two or more consecutive dots in the local part

image

  • Invalid max length

image

  • Hyphens at invalid positions in the domain

image

image

  • Leading or trailing dot in the local part

image

image

@AlaaElattar
Copy link
Copy Markdown
Contributor Author

image
image
image
image
image

Copy link
Copy Markdown
Contributor

@zaelgohary zaelgohary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use email validator instead of regex?

Comment thread app/lib/services/tools_service.dart Outdated
@AlaaElattar AlaaElattar merged commit 34d5236 into development Nov 21, 2024
@AlaaElattar AlaaElattar deleted the development_fix_email_validation branch November 21, 2024 09:55
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.

3 participants