mathiasbynens / emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.
https://mths.be/emoji-regex
MIT License
1.74k stars 174 forks source link

Smaller regex using regexgen #8

Closed devongovett closed 7 years ago

devongovett commented 7 years ago

regexgen is a package I wrote which generates regular expressions from a list of strings, similar to regex-trie. However, it applies some additional algorithms to generate smaller regular expressions. You can read about how it works in the readme.

For emoji-regex, the generated regex goes from 3.55 KB to 2.85 KB in size (a ~20% reduction). Also, the build script is simpler since regexgen uses regenerate for character class generation already, so no need to generate two separate parts.

mathiasbynens commented 7 years ago

@devongovett This looks great, as does regexgen! 👍

The CI build is failing because of the old support matrix. I’ll drop support for old Node.js versions first and then merge this!

mathiasbynens commented 7 years ago

Done. Could you please rebase this?

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling f3298da2d48e45e1ef816a459356cc6d39790cb7 on devongovett:regexgen into edd87c3da5fe0dd1e9d8722b247ad08bd410aaaa on mathiasbynens:master.

devongovett commented 7 years ago

Done!