Skip to content

Instantly share code, notes, and snippets.

@martinusso
Last active April 25, 2022 12:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save martinusso/39f52e3442dc2e35e4b698167c695caa to your computer and use it in GitHub Desktop.
Save martinusso/39f52e3442dc2e35e4b698167c695caa to your computer and use it in GitHub Desktop.
Delphi Email Address Validator
// uses RegularExpressions;
function ValidateEmail(const emailAddress: string): Boolean;
var
RegEx: TRegEx;
begin
RegEx := TRegex.Create('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]*[a-zA-Z0-9]+$');
Result := RegEx.Match(emailAddress).Success;
end;
@pushkin42
Copy link

pushkin42 commented Oct 2, 2018

unicode symbols after @?)

@L1NDS0N
Copy link

L1NDS0N commented Apr 25, 2022

^[\w-.]+@([\w-]+.)+[\w-]{2,4}$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment