Skip to content

Commit

Permalink
Add REGEX_TEXT_PRESENTATION; release v4.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
janlelis committed Nov 19, 2024
1 parent d130f74 commit 5f188b1
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 4.0.4

- Add `REGEX_TEXT_PRESENTATION` to be able to match for raw default-text Emoji codepoints

## 4.0.3

- Remove emoji-test.txt from Rubygems package
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Gem Regex (`Unicode::Emoji`'s Emoji support level) | Native Regex (Ruby's Emoji
`Unicode::Emoji::REGEX_PROP_MODIFIER_BASE` | `/\p{EBase}/`
`Unicode::Emoji::REGEX_PROP_COMPONENT` | `/\p{EComp}/`
`Unicode::Emoji::REGEX_PROP_PRESENTATION` | `/\p{EPres}/`
`Unicode::Emoji::REGEX_TEXT_PRESENTATION` | `/[\p{Emoji}&&\P{EPres}]/`

#### Extended Pictographic Regex

Expand Down
1 change: 1 addition & 0 deletions data/generate_constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def compile(emoji_character:, emoji_modifier:, emoji_modifier_base:, emoji_compo

# Matches only basic single, textual emoji, ignores components like modifiers or simple digits
regexes[:REGEX_TEXT] = Regexp.compile(text_emoji)
regexes[:REGEX_TEXT_PRESENTATION] = Regexp.compile(text_presentation)

# Export regexes for Emoji properties so they can be used with newer Unicode than Ruby's
regexes[:REGEX_PROP_EMOJI] = Regexp.compile(emoji_character)
Expand Down
1 change: 1 addition & 0 deletions lib/unicode/emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module Emoji
REGEX_POSSIBLE
REGEX_BASIC
REGEX_TEXT
REGEX_TEXT_PRESENTATION
REGEX_PROP_EMOJI
REGEX_PROP_MODIFIER
REGEX_PROP_MODIFIER_BASE
Expand Down
2 changes: 1 addition & 1 deletion lib/unicode/emoji/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Unicode
module Emoji
VERSION = "4.0.3"
VERSION = "4.0.4"
EMOJI_VERSION = "16.0"
CLDR_VERSION = "46"
DATA_DIRECTORY = File.expand_path('../../../data', __dir__).freeze
Expand Down
8 changes: 8 additions & 0 deletions lib/unicode/emoji/generated/regex_text_presentation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by a script, please do not edit it by hand.
# See `$ rake generate_constants` and data/generate_constants.rb for more info.

module Unicode
module Emoji
REGEX_TEXT_PRESENTATION = /[\#\*0-9ยฉยฎโ€ผโ‰โ„ขโ„นโ†”-โ†™โ†ฉโ†ชโŒจโโญ-โฏโฑโฒโธ-โบโ“‚โ–ชโ–ซโ–ถโ—€โ—ปโ—ผโ˜€-โ˜„โ˜Žโ˜‘โ˜˜โ˜โ˜ โ˜ขโ˜ฃโ˜ฆโ˜ชโ˜ฎโ˜ฏโ˜ธ-โ˜บโ™€โ™‚โ™Ÿโ™ โ™ฃโ™ฅโ™ฆโ™จโ™ปโ™พโš’โš”-โš—โš™โš›โšœโš โšงโšฐโšฑโ›ˆโ›โ›‘โ›“โ›ฉโ›ฐโ›ฑโ›ดโ›ท-โ›นโœ‚โœˆโœ‰โœŒโœโœโœ’โœ”โœ–โœโœกโœณโœดโ„โ‡โฃโคโžกโคดโคตโฌ…-โฌ‡ใ€ฐใ€ฝใŠ—ใŠ™๐Ÿ…ฐ๐Ÿ…ฑ๐Ÿ…พ๐Ÿ…ฟ๐Ÿˆ‚๐Ÿˆท๐ŸŒก๐ŸŒค-๐ŸŒฌ๐ŸŒถ๐Ÿฝ๐ŸŽ–๐ŸŽ—๐ŸŽ™-๐ŸŽ›๐ŸŽž๐ŸŽŸ๐Ÿ‹-๐ŸŽ๐Ÿ”-๐ŸŸ๐Ÿณ๐Ÿต๐Ÿท๐Ÿฟ๐Ÿ‘๐Ÿ“ฝ๐Ÿ•‰๐Ÿ•Š๐Ÿ•ฏ๐Ÿ•ฐ๐Ÿ•ณ-๐Ÿ•น๐Ÿ–‡๐Ÿ–Š-๐Ÿ–๐Ÿ–๐Ÿ–ฅ๐Ÿ–จ๐Ÿ–ฑ๐Ÿ–ฒ๐Ÿ–ผ๐Ÿ—‚-๐Ÿ—„๐Ÿ—‘-๐Ÿ—“๐Ÿ—œ-๐Ÿ—ž๐Ÿ—ก๐Ÿ—ฃ๐Ÿ—จ๐Ÿ—ฏ๐Ÿ—ณ๐Ÿ—บ๐Ÿ›‹๐Ÿ›-๐Ÿ›๐Ÿ› -๐Ÿ›ฅ๐Ÿ›ฉ๐Ÿ›ฐ๐Ÿ›ณ]/
end
end
8 changes: 8 additions & 0 deletions lib/unicode/emoji/generated_native/regex_text_presentation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by a script, please do not edit it by hand.
# See `$ rake generate_constants` and data/generate_constants.rb for more info.

module Unicode
module Emoji
REGEX_TEXT_PRESENTATION = /[\p{Emoji}&&\P{EPres}]/
end
end

0 comments on commit 5f188b1

Please sign in to comment.