Code Monkey home page Code Monkey logo

Comments (7)

afair avatar afair commented on June 17, 2024 1

Ah, I see. The address tag could be any reasonable set of characters, but the mailbox part (lloyd) would need to conform. Standard format will work, but may be too lax for user email addresses. Upcoming work should address this better, I'll see what I can do for this branch.

from email_address.

afair avatar afair commented on June 17, 2024

Hi,

Yes addresses ending with an underscore is RFC-compliant, but "suspicious" as a well-formed user address in what we call "conventional". You can add local_format: :standard as an option to the valid?() call which will consider your address as an RFC standard address.

Is this address from a large email provider (google, msn, yahoo, aol ,etc)? Those shouldn't end in the underscore, but private mail hosts can do anything, but still seem suspicious as a "formal" personal address. I may need to reconsider such formulations.

from email_address.

JoelESvensson avatar JoelESvensson commented on June 17, 2024

It's an icloud-address

from email_address.

legolin avatar legolin commented on June 17, 2024

I also recently ran into this (a hotmail address). As of the last time I checked, outlook.com lets me create emails with trailing underscore.

from email_address.

lloydwatkin avatar lloydwatkin commented on June 17, 2024

I'm seeing a similar error with a hyphen:

2.6.5 :003 > email = '[email protected]'
 => "[email protected]" 
2.6.5 :004 > ::EmailAddress.new(email).valid?
 => false

local_format: :standard works just fine! Thanks.

from email_address.

babaralishah avatar babaralishah commented on June 17, 2024

Hi
I am on Angular

And using the below regex:

'^[a-z0-9]+([._-]?[a-z0-9]+)+@[a-z0-9]+([._-]?[a-z0-9]+)+\\.[a-z]{2,3}$'

But its not fulfilling my requirement, my requirement is below:

saa5@me-d_d_u.co

please anyone tell me, why this regex is not working for my above mentioned case.

Regards
Babar Ali Shah

from email_address.

afair avatar afair commented on June 17, 2024

Your problem is the \. in the match which needs to only be . to match a period. \. Will match a \ followed by any character.
Search the web for a "regex tester" to build it interactively.

BTW, this is not a good regex for email because it is too simple to cover most cases. Also, _ is not allowed in domain names.

from email_address.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.