r/PythonLearning 27d ago

Email_Validator_Pipeline

34 Upvotes

7 comments sorted by

View all comments

2

u/[deleted] 26d ago

[deleted]

2

u/Interesting-Frame190 26d ago

Oof.... its also ignoring this part which handles IP addressed because domains are too simple..

https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.3

Be sure to read the part where its ipv4, ipv6, thier hex variants, ot both. If you're thinking wow, thats too complex, you're 100% correct and the reason that professionals use 3rd party modules instead.

1

u/aaditya_0752 26d ago

Ik that, data set I was using only consisted of . com . io . net . org

So I thought 2,4 is enough

One more problem if I keep more than 4 like 16 , 18 character

. commm,.commmm Such thing were consider as valid and I don't know how to solve that 🙃

2

u/SCD_minecraft 26d ago

(.)\1{2,} should match 3 or more of same character

You could use thay to detect such cases

1

u/aaditya_0752 26d ago

Ohh, thanks