Validating email with regular expression
I’ve been working on a little project recently that involves handling hundreds of millions of email addresses from various sources.More on that in a later post, but for now let’s just assume that I want to have a reasonable degree of confidence that each of these addresses from an untrusted source is valid.If you see any reckon are actually legal per the spec, yell out: !
I grabbed Phil’s from the post above which looks like this: Huh? If, for argument’s sake, 10% of those are false positives (and I highly doubt it’s that high), we’re looking at 0.04% of the original dataset being invalid.Character Limit – the default text box in a Google form allows users to input any number of characters but you can impose a limit with the help of regular expression.Here we limit the input to 140 characters much like Twitter. Word Limit – If you would like to limit the number of words that a user can type in the input field of a Google Form, there’s a regex for that as well.Indeed many of them are just rubbish – beyond the obvious “does it have an @ symbol”, a bunch of them don’t have dots in the domains or contain illegal characters in places where they just shouldn’t be.Clearly it’s time for a regex because you can fix anything with a regex, right? I thought the easiest way to get this right straight off the bat would be to just grab a regex validator from an ASP.