Proper Unicoding

1 · Jan Lelis · May 10, 2016, midnight
Ruby's Regexp engine has a powerful feature built in: It can match for Unicode character properties. But what exactly are properties you can match for? The Unicode consortium not only assigns all codepoints, it also publishes additional data about their assigned characters. When searching through a string, Ruby allows you to utilize some of this extra knowledge. Property Regexp Syntax Within a regular expression, use the \p directive: /\p{ PROPERTY NAME }/ To invert the property (matching cha...