-
Hi. I am having a hard time grabbing/matching the emoji. I have tried to use these:
I tried to digest the "EMOJI" here https://github.com/search?q=org%3Apest-parser+emoji&type=code, but no luck. // main.rs
use pest::Parser;
use pest_derive::Parser;
#[derive(Parser)]
#[grammar = "template.pest"]
pub struct TemplateParser;
fn main() {
let mut output = "👶 I am bilbo".to_string();
let pairs = TemplateParser::parse(Rule::spec, &output)
.unwrap()
.next()
.unwrap();
println!("{:#?}", pairs);
}
Thanks! Any help gladly appreciated ❤️ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hm, in theory, there should be a builtin It's of course possible to extract emojis with a general unicode rule (e.g. you can use |
Beta Was this translation helpful? Give feedback.
-
The PR of my previous submitted, it just let Pest including the unicodes of common languages. But I am not check the Emoji unicodes. This in Ruby regex, we can use |
Beta Was this translation helpful? Give feedback.
@azzamsa 2.7.0 was just published: https://github.com/pest-parser/pest/releases/tag/v2.7.0
It has the fix for the emoji builtin rules, so if you upgrade your pest crates to 2.7.0, you should be able to use EMOJI and other relevant builtin rules