Steven Levithan (@slevithan) 's Twitter Profile
Steven Levithan

@slevithan

Creator → Regex+, Oniguruma-To-ES, xregexp.com, regex.cool
Coauthor → Regular Expressions Cookbook, High Performance JavaScript

ID: 14950335

linkhttps://slev.life calendar_today30-05-2008 01:30:08

1,1K Tweet

846 Followers

193 Following

LaurieWired (@lauriewired) 's Twitter Profile Photo

Stanford just found a natural alternative to Ozempic using some clever regex on the human proteome. Instead of manually searching through proteins, their one-liner “peptide predictor” regex narrowed down promising candidates. The calculation likely took just a few seconds.

Stanford just found a natural alternative to Ozempic using some clever regex on the human proteome.

Instead of manually searching through proteins, their one-liner “peptide predictor” regex narrowed down promising candidates.

The calculation likely took just a few seconds.
Steven Levithan (@slevithan) 's Twitter Profile Photo

Adding my new regex optimizer to Shiki: github.com/shikijs/textma… - 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 ⚡🚀

Steven Levithan (@slevithan) 's Twitter Profile Photo

Although it's not in the release notes, Shiki 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!

Steven Levithan (@slevithan) 's Twitter Profile Photo

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

Steven Levithan (@slevithan) 's Twitter Profile Photo

Over the last week, RedCMD and I 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 quality of the lib. github.com/slevithan/onig…

Steven Levithan (@slevithan) 's Twitter Profile Photo

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.

kishikawa katsumi 🍪 (@k_katsumi) 's Twitter Profile Photo

swiftregex.comをアップデートしてSwift Regexのデバッガを追加しました。パフォーマンスに影響するBacktrack数を調べたりステップごとに実行したりできます。

Steven Levithan (@slevithan) 's Twitter Profile Photo

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/onig…

Steven Levithan (@slevithan) 's Twitter Profile Photo

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/onig…

Steven Levithan (@slevithan) 's Twitter Profile Photo

The Onig optimizer (new release today!) built on the same parser github.com/slevithan/onig… is also in a class of its own, and has rapidly improved. (regexp-tree's optimizer is pretty good for JS regexes and was early inspiration, but the Onig version has surpassed it in many ways.)

Steven Levithan (@slevithan) 's Twitter Profile Photo

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/oniguruma…

Steven Levithan (@slevithan) 's Twitter Profile Photo

🚢 Released emoji-regex-xs v2.0. Now matches all underqualified emoji included in Unicode's emoji-test.txt list, to better match Mathias Bynens's excellent emoji-regex and real-world emoji use. Lib size reduced from 0.3 to 0.2 kB in the process :)

Steven Levithan (@slevithan) 's Twitter Profile Photo

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/rege…

Steven Levithan (@slevithan) 's Twitter Profile Photo

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/rege…

Steven Levithan (@slevithan) 's Twitter Profile Photo

Shiki's JS RegExp engine (for high quality syntax highlighting without WASM, built on top of my Oniguruma-To-ES library) now supports 100% of Shiki's 222 built-in languages 🎉 github.com/shikijs/shiki/…