Mac@programming.dev to Programming@programming.dev · 6 months agoStrings do too many thingsbuttondown.emailexternal-linkmessage-square43fedilinkarrow-up1105arrow-down113
arrow-up192arrow-down1external-linkStrings do too many thingsbuttondown.emailMac@programming.dev to Programming@programming.dev · 6 months agomessage-square43fedilink
minus-squareFeathercrown@lemmy.worldlinkfedilinkEnglisharrow-up1·edit-26 months agoEDIT: I’M DUMB I THOUGHT YOU MEANT A LITERAL “.” , that regex is indeed correct. Original: This is a valid address: user.name@[IPv6:2001:db8:1ff::a0b:dbd0] Relevant spec: https://www.rfc-editor.org/rfc/rfc5321#section-4.1.3 And you all doubted me… :P Edit: Wait, I also don’t think local-part even needs a “.” in it? user@domain.com should be valid as well.
minus-squareJesus_666@feddit.delinkfedilinkarrow-up5·edit-26 months agoAnd it’s matched by .+@.+ as it contains an @. Remember, we’re taking about regular expressions here so .+ means “a sequence of one or more arbitrary characters”. It does not imply that an actual dot is present. (And I overlooked the edit. Oops.)
EDIT: I’M DUMB I THOUGHT YOU MEANT A LITERAL “.” , that regex is indeed correct.
Original:
This is a valid address:
user.name@[IPv6:2001:db8:1ff::a0b:dbd0]
Relevant spec: https://www.rfc-editor.org/rfc/rfc5321#section-4.1.3
And you all doubted me… :P
Edit: Wait, I also don’t think local-part even needs a “.” in it? user@domain.com should be valid as well.
And it’s matched by
.+@.+
as it contains an @.Remember, we’re taking about regular expressions here so
.+
means “a sequence of one or more arbitrary characters”. It does not imply that an actual dot is present.(And I overlooked the edit. Oops.)