Replies: 3 comments 3 replies
-
|
Did you add |
Beta Was this translation helpful? Give feedback.
3 replies
-
With this grammar it's able to match some emojis, for instance ✅ but others like 🐇 or 👽 still don't match. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This one works: from lark import Lark
grammar = r"""
start: EMOJI+
EMOJI: /[\u0000-\U0010FFFF]/+
%import common.WS
%ignore WS
"""
parser = Lark(grammar)
tests = ["✅", "✅ 🐇", "👽", "😀😎🚀", "👨👩👧👦", "👍🏽", "⚽️"]
for s in tests:
print(s, "=>", parser.parse(s).pretty()) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to match unicode strings with a terminal.
What I've tried is:
Both of these return:
lark.exceptions.UnexpectedCharacters: No terminal matches '👽' in the current parser context, at line 3 col 5When parsing:
put 👽 5 5Beta Was this translation helpful? Give feedback.
All reactions