Skip to content

Instantly share code, notes, and snippets.

@jagmit
Created February 17, 2020 16:11
Show Gist options
  • Save jagmit/62760eea6332ef90282fa8fcfc08fa08 to your computer and use it in GitHub Desktop.
Save jagmit/62760eea6332ef90282fa8fcfc08fa08 to your computer and use it in GitHub Desktop.
Parse email addresses
RegExp exp = new RegExp(r"(([a-zA-Z\s,.]+)<)*?([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]*)>?");
String str = "Tilo Zimmermann <[email protected]>, Henning Pfennig <[email protected]>; Karsten, Chopin <[email protected]>; [email protected], [email protected], [email protected]<[email protected]>,";
Iterable<RegExpMatch> matches = exp.allMatches(str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment