Skip to content

Commit

Permalink
regex: added a few regex for emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
Snakeyesz committed Oct 31, 2020
1 parent a95f88a commit 248d7e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions regexp/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ var (
`^(http(s)?:\/\/)?(discord\.gg(\/invite)?|discordapp\.com\/invite)\/([A-Za-z0-9-]+)(\/?)$`,
)

// EmojiRegex matches a built in Emoji or discord emoji
EmojiRegex = regexp.MustCompile(`[\x{00A0}-\x{1F9EF}]|<(a)?:[^<>:]+:[0-9]+>`)

UnicodeEmojiRegex = regexp.MustCompile(`[\x{00A0}-\x{1F9EF}]`)

// DiscordEmojiRegexp matches an Emoji, or an Emoji ID
DiscordEmojiRegexp = regexp.MustCompile(`(<(a)?:([^<>:]+):)?([0-9]+)>?`)

Expand Down

0 comments on commit 248d7e7

Please sign in to comment.