Skip to content
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

Fixed mail-to regex allowing email addresses to have dots & hyphen as part of the user segment #6229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lilHermit
Copy link

Fixes #5080

@loops
Copy link
Contributor

loops commented Oct 4, 2024

Hi lilHermit,

This change appears to also allow the hyphen character to precede the @ symbol. However, whenever you want to match an explicit hyphen inside a character-class, the usual practice is to make it the final character of the set. Otherwise, it appears that you're actually trying to match a range of characters, as in [F-T] (all the characters F through T).

Indeed, if you put the proposed regex into the online regex tool at https://rustexp.lpil.uk/ it complains about a boundary error.

It may work as-is, but it's probably worth altering, to move the "-" to the final character after the "." and also mentioning in the commit comment the addition of the hyphen as a valid character before the "@".

@lilHermit
Copy link
Author

@loops Good shout, I have now rebased

@lilHermit lilHermit changed the title Fixed mail-to regex allowing email addresses to have dots in Fixed mail-to regex allowing email addresses to have dots & hyphen as part of the user segment Oct 7, 2024
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.

Implicit mailto links should match dots before the @-sign
2 participants