3 ms·
Depends on what you're doing. If it's data capture on some kind of competition page, then a more complicated email regex can increase data quality a lot. I hav
by blowski 12y ago
Depends on what you're doing. If it's data capture on some kind of competition page, then a more complicated email regex can increase data quality a lot.
I have built quite a lot of data capture forms, and while no or limited regex increased number of entries, a more complicated regex combined with checking MX records improved conversion rate, because there were fewer junk entries. I used `\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b` (taken from regular-expressions.info).
It has a few false positives and a few false negatives, but overall, it optimises conversion rates, which is what I was being paid for.
YMMV.
- masklinn 12y ago> \.[A-Z]{2,4} That should definitely be {2,}: * there are a bunch of gTLD with more than 4 characters: http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#ICANN-era_generic_top-level_domains http://en.wikipedia.org/wiki/List_of_Internet_top-level_doma... even ignoring geoTLD and brandTLD * ccIDN are all more than 4 characters since the ACE prefix ("xn--" for IDNA) is already 4 characters all on its own
- blowski 12y agoTrue. It probably does need a bit of an update.