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 <tt@tblub.de>, Henning Pfennig <hp@gov.co.uk>; Karsten, Chopin <kh@blub.de>; jagmit.bling@bmx.de, tim@cool.de, christian+eins@test.org<christian+eins@test.org>,";
Iterable<RegExpMatch> matches = exp.allMatches(str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment