Overview
Explore the intricacies of Unicode in JavaScript regular expressions in this JSConf EU 2015 talk by Mathias Bynens. Dive into the challenges developers face with Unicode in ECMAScript 5 and discover how ES6 (ECMAScript 2015) addresses these issues. Learn about the new 'u' flag for regular expressions, its impact on various regex operations, and how it improves Unicode handling. Understand the implications for HTML documents and learn how to transpile ES6 Unicode regular expressions to ES5. Gain insights into matching predefined Unicode categories, scripts, and blocks. By the end of this 25-minute presentation, acquire the knowledge to create Unicode-aware regular expressions in JavaScript with confidence, enhancing your ability to handle international user input and perform accurate string manipulation.
Syllabus
Intro
Quick intro to Unicode
The ES6 u flag for regular expressions
Unicode code point escapes
u flag disallows useless backslash escapes
Impact on the operator
Impact on character classes
Impact on character class escapes
Impact on the i flag
Impact on HTML documents
Support for the u flag
Transpiling E56 Unicode regular expressions to ES5
regexpu internals
Matching predefined Unicode categories/scripts/blocks
Takeaways
Taught by
JSConf