data/generate_constants.rb in unicode-emoji-3.5.0 vs data/generate_constants.rb in unicode-emoji-3.6.0

- old
+ new

@@ -76,14 +76,17 @@ ) non_component_emoji_presentation_sequence = \ "(?!" + emoji_component + ")" + emoji_presentation_sequence + text_keycap_sequence = \ + join(EMOJI_KEYCAPS.map{|keycap| pack([keycap, EMOJI_KEYCAP_SUFFIX]) }) + text_presentation_sequence = \ join( pack_and_join(TEXT_PRESENTATION)+ "(?!" + join(emoji_modifier, pack(EMOJI_VARIATION_SELECTOR)) + ")" + pack(TEXT_VARIATION_SELECTOR) + "?", - emoji_presentation + pack(TEXT_VARIATION_SELECTOR) + emoji_presentation + pack(TEXT_VARIATION_SELECTOR), ) emoji_modifier_sequence = \ emoji_modifier_base + emoji_modifier @@ -195,14 +198,17 @@ ) # Matches only basic single, textual emoji # Ignores "components" like modifiers or simple digits regexes[:REGEX_TEXT] = Regexp.compile( - "(?!" + emoji_component + ")" + text_presentation_sequence + join( + "(?!" + emoji_component + ")" + text_presentation_sequence, + text_keycap_sequence, + ) ) - # Matches any emoji-related codepoint - Use with caution (returns partil matches) + # Matches any emoji-related codepoint - Use with caution (returns partial matches) regexes[:REGEX_ANY] = Regexp.compile(emoji_character) # Combined REGEXes which also match for TEXTUAL emoji regexes[:REGEX_INCLUDE_TEXT] = Regexp.union(regexes[:REGEX], regexes[:REGEX_TEXT]) @@ -228,13 +234,13 @@ ) write_regexes(regexes, File.expand_path("../lib/unicode/emoji/generated", __dir__)) native_regexes = compile( emoji_character: "\\p{Emoji}", - emoji_modifier: "\\p{Emoji Modifier}", - emoji_modifier_base: "\\p{Emoji Modifier Base}", - emoji_component: "\\p{Emoji Component}", - emoji_presentation: "\\p{Emoji Presentation}", - picto: "\\p{Extended Pictographic}", - picto_no_emoji: "\\p{Extended Pictographic}(?<!\\p{Emoji})" + emoji_modifier: "\\p{EMod}", + emoji_modifier_base: "\\p{EBase}", + emoji_component: "\\p{EComp}", + emoji_presentation: "\\p{EPres}", + picto: "\\p{ExtPict}", + picto_no_emoji: "\\p{ExtPict}(?<!\\p{Emoji})" ) write_regexes(native_regexes, File.expand_path("../lib/unicode/emoji/generated_native", __dir__))