Regex+ 6.1.0 released. Adds even cleaner and more robust interpolation of RegExp instances and partial patterns. And improved docs. 😀 github.com/slevithan/re...
Regex+ 6.1.0 released. Adds even cleaner and more robust interpolation of RegExp instances and partial patterns. And improved docs. 😀 github.com/slevithan/re...
Oniguruma-To-ES now has 12M dl/m. Most of that comes from Shiki, which uses it to make VSCode-style syntax highlighting possible in native JS (no large WASM). I like to think it's contributing to Shiki's rapid growth :) Recent example is in Vercel's streamdown.ai
Neither @antfu.me nor I thought this was possible when we started down this road. But it's finally done 😁
Great tips
The latest version of Regex Colorizer (a project I started in 2007) is finally available via npm, after getting the package name transferred to me 😊 github.com/slevithan/re...
Thanks so much @brc-dd.dev for the generous sponsorship!! Appreciate all the great work you do for VitePress and open source!
Improved the docs for regex-recursion, highlighting standalone usage (without Regex+). Less than 2 kB for recursive regex matching with support for all ES2025 regex syntax. github.com/slevithan/re...
🚢 Released emoji-regex-xs v2.0. Now matches all underqualified emoji included in Unicode's emoji-test.txt list, to better match @mths.be's excellent emoji-regex and real-world emoji use. Lib size reduced from 0.3 to 0.2 kB in the process :)
Regular expressions should not change the length of a match based on case insensitivity. My case for a breaking change in Oniguruma: github.com/kkos/oniguru...
oniguruma-to-es v4.2.0 shipped! 🚢 Continues improving by far the most sophisticated regex translator in the world. JS coders who've never used Oniguruma might still find it useful if they want much more feature-rich regexes (with native perf!) github.com/slevithan/on...
I hit this too. It's fixed now, but at the time, `npm login` fixed it for me (the 404 was a misleading message).
oniguruma-parser v0.10.0 brings a bunch of quality of life improvements. 🚀 The regex optimizer it includes, which is probably the most interesting part for people who don't regularly use Oniguruma, has continued to improve! github.com/slevithan/on...
Any React Native devs, can you help me by testing whether Regex+ works at all in RN 0.75.1+ or RN 0.74.6+? 🙏🏻😌 Related issue: github.com/slevithan/re...
Migrated a bunch of tests from Jasmine to Vitest so I could use TypeScript more easily. Super nice! ⚡ Will be trying to use Vitest everywhere from now on.
Over the last week and with major help from RedCMD, we converted all of oniguruma-parser from JS to TS. 🎉 Surprised that all of this work uncovered 0 bugs (despite the high complexity of the migrated code), which I think speaks to the pre-existing high quality of the lib. github.com/slevithan/on...
Request to run VS Code's syntax highlighting grammars through my Oniguruma regex optimizer (like Shiki does), which would improve highlighting performance for some languages like C++ and reduce the size of VS Code: github.com/microsoft/vs...
Just shipped version 0.6 of oniguruma-parser, which includes a new optimization that is able to automatically identify and fix some ReDoS vulnerabilities without changing what the regex matches. It already identified one such regex in the Haskell grammar used by @shiki.style
Although it's not in the release notes, @shiki.style 3.2.0 includes slight-to-major performance improvements for many languages (for both the Oniguruma and JS engines), thanks to the new regex optimizer from `oniguruma-parser`. Worth upgrading!
Adding my new regex optimizer to @shiki.style: github.com/shikijs/text... - It shaves more than 35,000 chars off just the C++ grammar (as an example) compared to the prior minification (without any change in meaning), and makes some of its regexes significantly faster ⚡🚀
More oniguruma-parser updates! An example of what it's optimizer/minifier can do, in the image. Some transforms can significantly improve perf for complex regexes 🚀
Lots of improvements released for my new Oniguruma optimizer (minifies regexes and improves their perf), plus added a new demo page: github.com/slevithan/on...
New launch! `oniguruma-parser` extracts the parser/traverser from my Oniguruma-To-ES transpiler, makes a ton of improvements, and adds new code generator and optimizer modules: github.com/slevithan/on... Great for TextMate grammar authors and anyone who works with Oniguruma regexes
Oniguruma-To-ES v3.1.0 includes a new feature I think is new in JS: Lazy construction of RegExp objects, deferred until first use in a search (with nothing observably different before/after). Also allows lazy-compile based on pattern length, since only very long patterns are slow to construct in V8
Using Oniguruma → JavaScript regex transpilation in VS Code for syntax highlighting is getting community support: github.com/microsoft/vs... Add a thumbs up on the issue if you think it's a good idea 😊
Cool 😊 I saw you mentioned its possessive quantifiers before, too. Happy to answer any questions, and very open to any feedback
Here's the same exact thing but readable/maintainable, using Regex+ (can be minified to a regex literal using its Babel plugin).
Yeah, it's helpful (and accurate) to think of all assertions (^, $, \b, \B, lookaround) as matching an empty string at their qualifying positions.
oniguruma-to-es hits a big milestone with v2.0 by comprehensively supporting the extremely flexible \G anchor (which has no direct equivalent in JS regexes). See github.com/slevithan/on...
Ever wondered why there aren't good tools for converting between different regex flavors automatically?
Would you use a universal regex translator in your own projects?
Want to help build one?
github.com/slevithan/on...
oniguruma-to-es v1.0.0 is out! ✨ The new release includes lots of edge case fixes reported by Oniguruma expert RedCMD, making its emulation even more accurate github.com/slevithan/on...