Is it bad that I didn't read the title of this post until after I recognized it was a regular expression and started reading it? Do I have brain disease?
At least you're not alone, I did the same thing... I've used regular expressions in vim over several decades and I have to remind myself that the script syntax may seem quite foreign to some people.
The dot-detecting element is ([\w-]+\.)+ , which should repeatedly match segments that consist of at least one word character or dash followed by a dot. So it shouldn't match blah....com, but I think it would match -.-.-.-.-.com. At least I think that's how it works, I don't use \w a whole lot when I do regexes.
AyatollahBahloni
It is the black speech, which I will not utter here.
zerneus
https://regex101.com/
OriginalPiR8
Fucking love that site
UglyDanTheUglyMan
Is it bad that I didn't read the title of this post until after I recognized it was a regular expression and started reading it? Do I have brain disease?
StrayCatsMakeGreatKibble
At least you're not alone, I did the same thing... I've used regular expressions in vim over several decades and I have to remind myself that the script syntax may seem quite foreign to some people.
fsharpminor3s
oh, it verifies a valid email address
76000BatteryLlamas
boob@boob.boob
heteroscedastic
Sweet summer child,
https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression
MaddogDelphi1997
+@.+\..+ might work for verifying email. But stackoverflow says the proper way to verify this is by sending a mail with a verification link.
BobTheWeak
It *attempts* to verify an email address, but it's very wrong and will fail.
[deleted]
[deleted]
Chrondeath
It's got a plus on the section checking for bits ending in dots, it ought to be ok with .co.uk I think?
[deleted]
[deleted]
Chrondeath
The dot-detecting element is ([\w-]+\.)+ , which should repeatedly match segments that consist of at least one word character or dash followed by a dot. So it shouldn't match blah....com, but I think it would match -.-.-.-.-.com. At least I think that's how it works, I don't use \w a whole lot when I do regexes.
pipatron
Some valid addresses, it misses some.
Hekatombe
Lots of valid addresses get missed. But that may be for the better... Unless you want a visit from this guy https://youtu.be/JERBqoTllaE
PowerPedant
It misses A LOT. All the ones with TLDs longer than four characters, for starters.
AttilaTheHungover
It may have validated an email at one time, but they keep moving the goal posts.
PowerPedant
No goalpost moving required: That RegEx wouldn't even validate all valid addresses as defined in RfC 822 from 1982.