DEV Community

Cover image for Rubree: A Modern Ruby Regex Editor Running Fully in Your Browser
shimokawa
shimokawa

Posted on • Originally published at github.com

Rubree: A Modern Ruby Regex Editor Running Fully in Your Browser

I’m excited to announce Rubree, a modern regular expression editor for Ruby developers — inspired by Rubular but rebuilt from scratch using Ruby, Rails, and WebAssembly (Wasm).

Rubree Screenshot


💡 Why Rubree?

Rubular has long been a beloved tool for Rubyists, but it comes with some limitations:

  • Runs on older Ruby 2.5.9, which affects speed and maintainability
  • Not open-source, making customization and internal investigation difficult
  • Matching is server-dependent, requiring backend processing for every input
  • Cannot visualize regex structure as a railroad diagram (like Regexper)
  • Replacement preview is unavailable

Rubree addresses these challenges by redesigning both the UI and backend logic, running entirely in the browser for a fast, modern regex experience.


🔍 Key Features

■ In-Browser Regex Evaluation (Wasm)

All regex evaluation runs locally in the browser using WebAssembly-powered Ruby.

No network latency, and input responses feel instant.

■ Regex Structure Visualization (Railroad Diagrams)

Using regexp_parser for parsing and railroad_diagrams for SVG rendering,

Rubree provides clear, visual insights into your regex structure.

Perfect when you want to understand how your regex actually connects patterns.

■ Substitution Preview

Replacements directly in the browser and preview results instantly.

■ Ruby Code Snippet Generation

Generate ready-to-use Ruby code directly from your regex input.

■ Shareable URLs

Click the share icon to encode your current input in Base64 and generate a URL.

Share with teammates or in chat, and they can reproduce the same state instantly.


🔧 How to Use

First Visit

  1. Visit Rubree Demo
  2. Click "Get started"
  3. Initial Wasm loading takes about 10 seconds

Subsequent Visits

  • Depending on browser cache, a few seconds of loading may occur. This is due to browser behavior, not Wasm.

Basic Flow

  1. Enter your regex
  2. Enter sample text
  3. Check matches, replacement results, and structure diagrams

Try Sample Texts

  • Try this example: auto-fill a sample
  • Dice icon: display a random text
  • Regex Examples: choose from a curated list

Zoom & Share Diagrams

  • Magnifying glass icon: zoom in
  • Clipboard icon: copy the SVG diagram

🧱 Tech Stack

Rubree is built on Ruby 3.3 + Rails 8.0 and runs in the browser using Wasmify Rails.

Unsupported Versions

  • Ruby 3.4: WebAssembly Ruby has bigdecimal issues
  • Rails 8.1: json gem native extensions cannot build on Wasm

Server-side deployment avoids these issues.

⚙️ Backend

  • Ruby 3.3
  • Rails 8.0
  • Regexp::Parser

🎨 Frontend

  • Hotwire
  • TailwindCSS
  • RailroadDiagrams (SVG)

🛠 Development

  • Foreman
  • Lefthook

🧹 Lint / Testing

  • Rubocop / ERB Lint / Biome
  • RSpec
  • Playwright
  • Octocov

🚀 Build / Deployment

  • Wasmify Rails → WebAssembly
  • GitHub Pages

🤖 Security (Shift-left)

  • Dependabot
  • Gitleaks
  • Brakeman

▶️ CI/CD

  • GitHub Actions

🧩 Background

  • Started in 2022 as a FJORD BOOT CAMP graduation project
  • Inspired by demand for an open-source Rubular alternative
  • RubyKaigi 2025 LT helped define the combination of regexp_parser + railroad_diagrams
  • Built a browser workflow: AST parsing → SVG rendering → Wasm execution
  • Achieved full Rails app execution in the browser

🚀 Final Thoughts

Rubree is a one-stop regex tool for Rubyists, long-time Rubular users, and anyone learning regular expressions.

Use it for quick code testing, learning, or exploring complex regex patterns.

Questions or feature requests? Open an issue on GitHub:

👉 Rubree Issues

Happy regexing! 🔍✨

Top comments (0)