Skip to content

Instantly share code, notes, and snippets.

@mikatalk
Created September 27, 2013 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikatalk/6733231 to your computer and use it in GitHub Desktop.
Save mikatalk/6733231 to your computer and use it in GitHub Desktop.
Find all email addresses in a string (*not validation):
var s:String = "rew+hello-wOrld@we2y.com hey wasup! , email.blabla@gmail.com zguegue@morue.fr";
var rex:RegExp = /[^\s,]+@[^\s,]+/g;
trace( s.match(rex).join(",") );
@mikatalk
Copy link
Author

or
var rex:RegExp = /[a-zA-Z0-9.!#$%&'+-/=?^`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)_/g

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