Skip to content

Instantly share code, notes, and snippets.

@mastern2k3
Created November 25, 2018 11:57
Show Gist options
  • Save mastern2k3/4be42a528f05db74e67f72e44d0e1c37 to your computer and use it in GitHub Desktop.
Save mastern2k3/4be42a528f05db74e67f72e44d0e1c37 to your computer and use it in GitHub Desktop.
import java.util.regex.Matcher;
import java.util.regex.Pattern;
String emojiString = "😋 Get Emoji — All Emojis to ✂ Copy and 📋 Paste 👌";
String emoniRegex = "([\\u20a0-\\u32ff\\ud83c\\udc00-\\ud83d\\udeff\\udbb9\\udce5-\\udbb9\\udcee])";
String extractedEmojis = "";
Matcher matcher = Pattern.compile(emoniRegex).matcher(emojiString);
while (matcher.find()) {
extractedEmojis += matcher.group();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment