I noticed the text emoji regex was using an inefficient method of optionally matching the variation selector \uFE0F after \p{Emoji}. Due to all the character class expansions, this ends up bloating the generated regex with duplicate paths. Switching the match to just make \uFE0F optional brings down the size of the generated regex considerably:
I noticed the text emoji regex was using an inefficient method of optionally matching the variation selector
\uFE0F
after\p{Emoji}
. Due to all the character class expansions, this ends up bloating the generated regex with duplicate paths. Switching the match to just make\uFE0F
optional brings down the size of the generated regex considerably:I also added a looped test for all the
\p{Emoji}
characters to verify it still matches everything correctly.