Created
August 21, 2019 21:29
-
-
Save HKGx/180cdd1aacf6f78c2b5a060a78efe565 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUserFromMentionRegExWithLengthCheck(mention) { | |
const matches = mention.match(/^<@!?(\d{18})>$/); | |
if (!matches) return; | |
const id = matches[1]; | |
return users.get(id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment