Squeezing Unicode Names into Ruby Regular Expressions
summary
Implements Unicode name → code point lookup in Ruby and integrates it with regular expressions and String, using tries and radix branches and aggressive bit-packing of nodes so many leaves store code points inline; detects and encodes algorithmic name ranges (Hangul, braille, etc.) instead of listing every name. The implementation passes full Unicode tests, runs about 300k lookups/sec, uses roughly 410 KB of runtime data, and is available on GitHub.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 2:17Unicode properties in regex
- 5:05Limitations of current Unicode support
- 10:24Need for name-to-codepoint lookup
- 11:29Building a trie for Unicode names
- 16:24Optimizing the trie structure
- 22:25Radix trees for compact storage
- 25:59Algorithmically defined names
- 27:49Performance and memory usage
- 29:15Summary and future work
- 30:18Acknowledgements and Q&A
related talks
39mRegular Expressions Inside Out
35mRuby and Unicode, what could go wr�ng?
38mTen Unicode Characters You Should Know About as a Programmer
24mThe Power and Responsibility of Unicode Adoption
43mJavascript ♥ Unicode
26mJavaScript ♥ Unicode
32mWhy We Can't Have Nice Things: Unicode, Dates, and Names
32mRegExp.prototype.unicode
