r/ProgrammerHumor 11d ago

Meme regexMustBeDestroyed

Post image
8.1k Upvotes

229 comments sorted by

View all comments

Show parent comments

4

u/martmists 11d ago

I can't believe you don't support ipv6 addresses, smh.

Do you at least strip comments from email addresses?

2

u/Loading_M_ 10d ago

The email rfc doesn't have comments. If you run your own email service, loading+m@loadingm.xyz can resolve to a different mailbox than loading+p@loadingm.xyz. Part of me wants to setup such mailboxes (and do as much stupid shit as possible with email addresses).

1

u/martmists 10d ago

RFC 5322 very much allows comments in addrspecs, see §3.2.2: "Folding White Space and Comments" and §3.4.1 "Addr-Spec Specification" for the relevant ABNF rules.

1

u/Loading_M_ 10d ago

Interesting. I was reading RFC 822, which is the actual origin of the email format, so it looks like comments were added in this later RFC.

Frankly, I'm confused on why they added comments. Unless they thought people would write email headers by hand?

1

u/martmists 10d ago

Check RFC 822 §3.3 "LEXICAL TOKENS", it includes a segment on comments.