---
title: "Why regexes starting with 'k' or 's' got slower in Ruby 4.0"
publication: "Ruby Weekly"
issue: 800
published_at: "2026-05-14"
canonical_url: "https://rubyweekly.com/issues/800"
---

Plus RubyGems signups are off for now, an alternative path to safer timeouts, and bringing post-quantum cryptography to Ruby.        

#​800 — May 14, 2026 

[Read on the Web](https://rubyweekly.com/issues/800)  

Together with [![Jidoka\](https://res.cloudinary.com/cpress/image/upload/c_fit,w_1280,h_377/e_make_transparent/co_white,e_outline:19/su7brp70hnl4xxsfq49m.png)](https://sinaptia.dev/jidoka?utm_source=cooperpress&utm_medium=newsletter&utm_campaign=rubyweekly-2026q2&utm_content=primary)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/phrekbqlyf70fmnussua.jpg)](https://railsatscale.com/2026-05-12-one-engine-many-tools/)  

[One Engine, Many Tools: Introducing Rubydex](https://railsatscale.com/2026-05-12-one-engine-many-tools/) — Prism unified Ruby’s parsing layer, and now Vinicius Stock (creator of [Ruby LSP](https://github.com/Shopify/ruby-lsp)) is betting the [Rubydex](https://github.com/Shopify/rubydex) static analysis toolkit can do the same one-level-up for code _indexing_, with Ruby LSP, Tapioca, and Packwerk already migrating. 

Vinicius Stock   

[Adopting Herb at GitHub](https://hawksley.org/2026/05/06/adopting-herb-at-github.html) — GitHub spent the past few months integrating the [Herb](https://herb-tools.dev/) ERB toolchain into its Rails monolith. Joel tells the tale, including what Herb caught that `erb_lint` missed in GitHub’s ~500,000 lines of ERB. 

Joel Hawksley (GitHub)   [![\](https://res.cloudinary.com/cpress/image/upload/c_limit,w_480,h_480,q_auto/copm/974b76d3.png)](https://sinaptia.dev/jidoka?utm_source=cooperpress&utm_medium=newsletter&utm_campaign=rubyweekly-2026q2&utm_content=primary) 

[Jidoka: Automation with a Human Touch](https://sinaptia.dev/jidoka?utm_source=cooperpress&utm_medium=newsletter&utm_campaign=rubyweekly-2026q2&utm_content=primary) — Turn your roadmap into a supervised software delivery line. Jidoka pairs coding agents with senior engineers, so teams can modernize legacy code, ship faster, with quality built-in. 

JIDOKA by SINAPTIA sponsor   

**⚡️ IN BRIEF:** 

- 🔒 Jun Aruga [proposes adding post-quantum cryptography support](https://bugs.ruby-lang.org/issues/22068) to Ruby's standard libraries, something [he's already worked on](https://github.com/ruby/openssl/issues/894) in Ruby's [openssl](https://github.com/ruby/openssl).
- 🤗 Richard Schneeman [suggests RubyGems.org should have a concept of 'alumni'](https://github.com/rubygems/roadmap/issues/15) to remember/recognize former maintainers of gems.
- 🇯🇵 [Kaigi on Rails 2026](https://kaigionrails.org/2026/) is a Japanese Rails conference taking place this October 16-17 in Tokyo. Dave Thomas and DHH are booked to keynote.
- 🇺🇸 [The CFP for _Rails World_](https://sessionize.com/rails-world-2026/) (September 23-24) closes in two days.   

[Ruby 4.0.4 Released](https://www.ruby-lang.org/en/news/2026/05/11/ruby-4-0-4-released/) — The latest CRuby is here. It’s a scheduled, routine update (which the latest stable release gets every two months) so there are no new features, but [a lot of bugfixes](https://github.com/ruby/ruby/releases/tag/v4.0.4), so it’s worth the upgrade. 

Takashi Kokubun  

🤓 My favorite fix is for a regression in 4.0 where [regexes starting with 'k' or 's' became slower](https://bugs.ruby-lang.org/issues/21824). Why? `s` and `k` are the only two ASCII letters with _two_ other characters that become case-equivalent with them (namely, S/ſ - long S, and K/K - the Kelvin sign) causing Onigmo to de-optimize such regexes.  

[RubyGems Signups Down as Spammers Target London Councils](https://socket.dev/blog/gemstuffer) — [RubyGems.org](https://rubygems.org/) has [temporarily disabled user signups](https://status.rubygems.org/incidents/cytf062tkwtt) (installs and pushes remain live) due to a ‘GemStuffer’ campaign where, oddly, public data shared by local councils in the UK is being turned into junk gems _en masse_. 

Joseph Edwards (Socket)   

[A Ruby Timeout That Works (on Linux)](https://beautifulruby.com/code/tcp-user-timeout) — In 2015, Mike Perham called `Timeout` [Ruby’s most dangerous API](https://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/) and its problems remain (namely that it won’t interrupt a blocking syscall). Brad is now working on [an alternative approach](https://github.com/rubymonolith/tcp_user_timeout), leaning on Linux’s `TCP_USER_TIMEOUT`. 

Brad Gessler   

[How Depot Got CI MicroVMs Booting in Under a Second](https://fandf.co/4uuXa7U) — Stop waiting for CI warm pools. Depot CI uses just-in-time microVMs that cold boot in under a second for faster builds. 

Depot sponsor   

📄 [Solidus vs. Spree](https://supergood.software/solidus-versus-spree/) – [Solidus](https://solidus.io/) and [Spree](https://spreecommerce.org/) are Rails-based e-commerce platforms that share a common ancestry. _(Note: This telling of the story is from the Solidus POV.)_ Jared Norman (SuperGood) 

📄 [Use `class_names` to Conditionally Apply CSS Classes in Rails](https://andycroll.com/ruby/use-class-names-to-conditionally-apply-css-classes/) – If you’re interpolating strings into `class` attributes, do this instead. Andy Croll 

📄 [A Reusable Drag-and-Drop Image Preview in Rails](https://railsdesigner.com/image-upload-element/) – How to build a drag-and-drop image upload custom element that works in Rails forms. Rails Designer  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/u8a2pcnzgzxd7p5rfpuk.jpg)](https://www.youtube.com/watch?v=wqxDGf46asE)  

▶[Rails Just Made Your Database Agent-Ready](https://www.youtube.com/watch?v=wqxDGf46asE) — A [recent PR to Rails core adds `rails query`](https://github.com/rails/rails/pull/57156) to allow read-only queries from the command line. The video covers the essentials with numerous examples. Of course, there’s [an agent skill](https://github.com/lewispb/rails-query-skill) that lets agents use it well to answer queries too. 

Emmanuel Hayford   

[🤖 Need Claude Skills Tailored to Your Engineering Org? Let’s Talk!](https://go.ombulabs.com/381) — We [open-sourced our Rails upgrade skills](https://github.com/ombulabs/claude-code_rails-upgrade-skill?utm_source=cooperpress&utm_medium=paidplacement&utm_campaign=rw-sponsored-link-may-14-2026-2&utm_term=os-claude-skill&utm_content=os-claude-skill) based on 60,000 hours of experience. Let’s build yours for a11y, dead code, or QA. 

Ombulabs.ai | Custom AI Solutions sponsor   

[ASTro: AST-Based Reusable Optimization Framework](https://github.com/ko1/astro) — Ruby core’s _ko1_ is working on an experimental optimization framework that generates specialized C code from AST interpreters. [Numerous sample implementations](https://github.com/ko1/astro#samples) span various subsets of Ruby, Lua, Pascal, and others. 

Koichi Sasada  

💡 Two of Koichi's ASTro-based Ruby implementations ([abruby](https://github.com/ko1/astro/tree/master/sample/abruby) and [koruby](https://github.com/ko1/astro/tree/master/sample/koruby)) can run the [optcarrot](https://github.com/mame/optcarrot) benchmark, and faster than CRuby (without YJIT) too.  

[ruby-warning 1.6: Custom Processing for Warnings](https://github.com/jeremyevans/ruby-warning) — A tidy way to customize Ruby warnings. For example: `Warning.dedup` to deduplicate them, `Warning.ignore(:missing_ivar, __FILE__)` to ignore a specific warning in the current file, or you can even hide all warnings from gem dependencies. 

Jeremy Evans   

- [rbspy 0.47](https://github.com/rbspy/rbspy) – The live sampling profiler has added Ruby 4.0.4 support.
- [Rack::JsonSchema 1.6](https://github.com/r7kamura/rack-json_schema) – JSON Schema-based Rack middleware offering request/response validation, mocking, and API documentation.
- [FriendlyId 5.7](https://github.com/norman/friendly_id) – The _"Swiss Army bulldozer"_ of slugging and permalink plugins for Active Record.
- [Cutoff 1.1](https://github.com/justinhoward/cutoff) – Enforcing total execution-time 'deadlines' with checkpoints.
- ☎︎ [Phonelib 0.10.20](https://github.com/daddyz/phonelib) – Phone number validation and formatting library.
- [MiniScheduler 0.20](https://github.com/discourse/mini_scheduler) – Adds recurring job scheduling to Sidekiq.
- [Chusaku 1.5](https://github.com/nshki/chusaku) – Annotate your Rails controllers with route info.         

Curated by [Peter Cooper](https://twitter.com/cooperx86) and [Glenn Goodrich](https://twitter.com/ruprict).
Published by [Cooperpress](https://cooperpress.com/). 

[Change your email](https://rubyweekly.com/edit_subscription/*|UID|*) or [Stop getting this newsletter.](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Other weekly newsletters we publish include [Postgres Weekly](https://postgresweekly.com/), [React Status](https://react.statuscode.com/), [Frontend Focus](https://frontendfoc.us/), and [JavaScript Weekly](https://javascriptweekly.com/).
