Paul Krill
Editor at Large

Mozilla revamps RegExp support in SpiderMonkey JavaScript engine

news
Jun 8, 20202 mins

New RegExp engine in Firefox Developer Edition closes the gap with regular expression features in ECMAScript

language / alphabet / letters / characters
Credit: andy.brandon50

Mozilla has outfitted its SpiderMonkey JavaScript runtime with a new regular expressions (RegExps) engine, to make it easier to support modern RegExps features. The new RegExp engine debuts in the Firefox 78 Developer Edition browser. 

RegExps are a heavily used tool for manipulating strings, offering a rich syntax to describe and capture character information. Mozilla in 2014 had replaced its YARR regular expression engine with a forked copy of Irregexp, the regular expression engine used in the Google V8 JavaScript engine. Mozilla heavily rewrote Irregexp to use its own APIs. This made it easier to work with the new engine, but harder to import new upstream features. And over time, Mozilla fell behind in supporting new ES2018 RegExp features.

Mozilla’s new approach—a  newly built shim layer for IrregExp—provides full access to V8 functionality, from memory allocation and code generation to data structures and utility functions. As a result, SpiderMonkey gains a stronger foundation for future RegExp support, one that allows the SpiderMonkey team to add new RegEx syntax more quickly. 

Mozilla said the effort has resulted in full support for all ECMAScript RegExp features. Mozilla is hopeful that its work on the new engine can be the basis for RegExp in Firefox for years to come. The Firefox Developer Edition, featuring latest developer tools in beta, can be accessed from mozilla.org.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author