Replies: 2 comments
-
Thank you for the feedback, and for sharing your amazing application. Works very nicely on the web! Unfortunately detecting emoji characters in Unicode is not trivial. The easiest way to go about it is probably to use the package emoji_regex. Its complicated regular expression can be used with the import 'package:emoji_regex/emoji_regex.dart';
import 'package:petitparser/petitparser.dart';
final emoji =
PatternParser(emojiRegex(), 'Emoji expected').map((each) => each[0]);
void main() {
const input = '😊, 🐪, 🇯🇵, 🙋🏿, 👨👩👧👦';
print(emoji.allMatches(input).join('\n'));
} Possibly it would be more efficient to implement the regular expression using PetitParser patterns, but to get started this is the easiest solution I can think of. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the help! It worked perfectly fine 🎉 |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you so much for this amazing package.
I've built notescalculator.com using it and it helped a lot.
May I know If there is a way to accept emojis in a parser?
I have this parser now
But I would like it to accept something like
👍 hello
orhel👍lo
Beta Was this translation helpful? Give feedback.
All reactions