Closed matt17r closed 2 years ago
Hey @matt17r, thank you for your comments and bug requests.
Changing that order seems the right thing to do. I'll put in on my TODO list for later this month.. (or maybe @radarek is faster!)
Hi @matt17r, this should be fixed in v3.1.1. Thanks again for the bug report.
Scanning family emojis (e.g.) using the "recommended" REGEX results in a smaller family and a separate kid rather than matching the whole emoji in 15 cases:
I think this is because of the order of the generated REGEX. I suspect it finds the smaller match first and stops looking... After modifying the generated REGEX in
lib/unicode/emoji/generated/regex.rb
toREGEX = /(?:(?:๐จโโค๏ธโ๐จ|๐จโโค๏ธโ๐โ๐จ|๐จโ๐ฉโ๐งโ๐ง|๐จโ๐ฆ|๐จโ๐ฆโ๐ฆ|...
(moving the ๐จโ๐ฉโ๐งโ๐ง earlier) that particular emoji started matching correctly.I have no idea how to update the generation logic to move those emojis to the front of the queue though?