Skip to content

Instantly share code, notes, and snippets.

@davistrent
Last active March 26, 2017 21:19
Show Gist options
  • Save davistrent/08ac2ec1eaa6006b79d8a4a11eb967bc to your computer and use it in GitHub Desktop.
Save davistrent/08ac2ec1eaa6006b79d8a4a11eb967bc to your computer and use it in GitHub Desktop.
var re = /#(foo|bar|baz)/i;
var message = '@bot #bAz';
var tagAttributes = message.match(re);
var tag = tagAttributes[1].toLowerCase();
console.log(tag);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment