marshmallow icon indicating copy to clipboard operation
marshmallow copied to clipboard

Added support for single character TLDs

Open gautamkrishnar opened this issue 3 years ago • 3 comments

Added support for single character TLDs for the email and domain validation. It will now support TLDs like a.a. Refer #1844 for more detaills.

fixes: #1844

gautamkrishnar avatar Jul 07 '21 06:07 gautamkrishnar

Thanks for the contribution and sorry for about the delay.

I have no objection to this, even if the SO answer underlines the fact that in practice there are currently no single character TLDs in the root.

Two things I'd like to check before merging:

  • Does this also affect URL?
  • What does Django do about this?

Also, please add yourself to AUTHORS.

lafrech avatar Mar 21 '22 14:03 lafrech

@lafrech Added myself to authors list. Eventhough there are no single character TLDs currently available right now, this will make the library future proof.

Does this also affect URL?

yes, this regex will affect the domain validations as well since email and domain validation shares the same regex.

What does Django do about this?

I don't use django personally, I am not sure about this.

gautamkrishnar avatar Mar 21 '22 16:03 gautamkrishnar

yes, this regex will affect the domain validations as well since email and domain validation shares the same regex.

I had a quick look and I thought it uses a different regex (see _regex_generator). I shall double-check.

I don't use django personally, I am not sure about this.

I don't either, but I remember some regexes being copied from there, and since I'm not proficient in regex, I find it nice to get them from there, or at least discuss the subject with them.

lafrech avatar Mar 21 '22 17:03 lafrech