Skip to content

Instantly share code, notes, and snippets.

@cgkio
Created December 11, 2013 19:52
Show Gist options
  • Save cgkio/7917235 to your computer and use it in GitHub Desktop.
Save cgkio/7917235 to your computer and use it in GitHub Desktop.
Regex remove everything after @ (including @)
REGEX: Trim everything up to and including =
var text = "[email protected]";
text = text.replace(/@.*$/,"");
console.log(text);
// results = "john"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment