Last active
January 1, 2025 18:05
-
-
Save laGameTV/1ef53c8073f51d0fefa0214fe561e32f to your computer and use it in GitHub Desktop.
Discord Emoji Regex Validator
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
const tests = [ | |
"π₯", | |
"π ", | |
"β", | |
"π€", | |
"π°", | |
"ποΈ", | |
"π", | |
"ποΈ", | |
"π", | |
"π€", | |
"π₯³", | |
"π", | |
"π§", | |
"Test", | |
"<:abc:12345678901234567>", | |
":SomeEmoji:", | |
"<:SomeEmoji:9876543210987654321>", | |
"<:D:1234509876543212345>", | |
"<:ABCD:876543210987654321>", | |
]; | |
tests.forEach((test) => { | |
const isValid = /^(?:<a?:\w{2,32}:\d{17,19}>|[\p{Emoji}])$/u.test(test); | |
console.log(isValid, test); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment