Regex to Detect Emoji Characters
Detect common emoji characters in text including emoticons, symbols, transport, flags, and miscellaneous Unicode emoji ranges. Free online regex pattern tester.
Regular Expression
/[\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F1E0}-\u{1F1FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu
Token Breakdown
| Token | Description |
|---|---|
| [\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F1E0}-\u{1F1FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}] | Character class — matches any one of: \u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F1E0}-\u{1F1FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF} |
Detailed Explanation
This regex detects common emoji characters by matching against several Unicode ranges where emojis are defined. Here is the token-by-token breakdown:
[...] — A character class containing multiple Unicode ranges for different emoji categories.
\u{1F600}-\u{1F64F} — Emoticons range. This covers the classic smiley faces, gestures, and people emojis. Includes grinning face, laughing, winking, and various hand gestures.
\u{1F300}-\u{1F5FF} — Miscellaneous Symbols and Pictographs range. This covers weather symbols, animals, plants, food, buildings, objects, and other pictographic symbols.
\u{1F680}-\u{1F6FF} — Transport and Map Symbols range. This covers vehicles, traffic signs, clocks, and other transport-related symbols like rocket, airplane, and car.
\u{1F1E0}-\u{1F1FF} — Regional Indicator Symbols range. These are used in pairs to create flag emojis. Each letter A-Z has a corresponding regional indicator symbol.
\u{2600}-\u{26FF} — Miscellaneous Symbols range. This covers additional symbols like sun, cloud, umbrella, snowman, and various other miscellaneous symbols.
\u{2700}-\u{27BF} — Dingbats range. This covers decorative symbols like checkmarks, crosses, stars, scissors, and various ornamental characters.
The g flag enables global matching and the u flag enables Unicode mode, which is required for the \u{...} syntax to work correctly. This pattern is useful for emoji counting, content filtering, text sanitization, and social media analytics. Note that this does not cover all emojis as the Unicode standard continues to add new emoji characters in later versions.
Example Test Strings
| Input | Expected |
|---|---|
| 😀 | Match |
| © | No Match |
| hello | No Match |
| 🚀 | Match |
| ☀ | Match |
Try It — Interactive Tester
Match Highlighting(3 matches)
Matches & Capture Groups
112 charsFlags: guMatches: 3Ctrl+Shift+C to copy regex