Skip to content

About RegexLab

RegexLab is a free regular-expression toolkit for people who write code in more than one language, and for people who just need to pull a few phone numbers out of a messy spreadsheet. It combines a live tester, a plain-English generator, a visual builder, a library of tested patterns, thirty lessons and a printable cheatsheet in one place, and it runs entirely in your browser.

Our mission

Regular expressions are one of the most useful tools in programming, and one of the easiest to get subtly wrong. A pattern copied from a forum may work in JavaScript and fail silently in Go, or match far more than intended in Python because \d means something different there. Our goal is to make regex practical and honest: show exactly what a pattern matches, explain it in plain English, convert it carefully between languages, and say clearly when something cannot be done.

What RegexLab does

  • Runs your pattern live against your text, highlights each capture group in its own colour, and lists matches in a table you can copy or export as CSV, JSON or TXT.
  • Supports four modes: test and extract, replace (with $1 and named groups), split, and full-match validation.
  • Converts patterns, flags and replacement strings between JavaScript, Python, PHP, Java, Go, C#, Rust, Ruby, and generates ready-to-paste code for each language with the correct string escaping and the native full-match API.
  • Checks compatibility against a feature table, warns about features a language lacks, and suggests an alternative that works.
  • Warns about patterns prone to catastrophic backtracking, and stops any run that takes longer than 500 ms without freezing the page.
  • Turns descriptions such as “5 digit code” or “dates like 12-01-2026” into loose, balanced and strict patterns using an offline, deterministic intent engine; no AI service is called.

What RegexLab does not do

Honesty about limits is part of the design. A browser can only execute the JavaScript regex engine, so the live preview always runs on JavaScript. For the other seven languages, RegexLab converts the pattern, flags, replacement and code, and checks known feature differences, but it does not run Python's re, PCRE2, Java, RE2, .NET, the Rust regex crate or Onigmo. Edge cases such as Unicode case folding, line-ending handling or engine-specific optimisations can therefore behave differently. If a pattern written for another language cannot run on the JavaScript engine at all, for example because it uses a possessive quantifier or an inline flag, the preview says “Cannot preview on the JS engine” instead of showing a result it cannot stand behind.

A regex checks the shape of text, not its truth. The library's card-number pattern does not run the Luhn checksum, the CNIC pattern cannot tell whether a number was really issued, and the email pattern is a practical subset rather than the full RFC 5322 grammar. Those limits are written on each pattern.

Privacy by design

There is no server-side processing, no account system and no analytics. Your text is processed in a Web Worker on your device and is never uploaded. Preferences such as theme, language, pattern history (patterns only, never text) and lesson progress are kept in your browser's local storage. The Privacy Policy lists every key.

How patterns and lessons are made and checked

Accuracy matters more than volume, so every piece of content goes through the same process before it is published:

  1. Written by hand. Each library pattern, generator template, lesson and guide is written individually; nothing is generated in bulk from a loop or scraped from other sites.
  2. Executed, not just proofread. Every pattern ships with strings it must match and strings it must reject. An automated test suite of 780+ tests runs all of them on every build, together with every lesson practice task (each has a reference solution) and every code example in the blog. A build with a failing example is not published.
  3. Checked across languages. The converter and compatibility checker are tested against a feature table for all eight languages, including the cases where a language cannot run a feature at all, such as lookbehind in Go and Rust.
  4. Honest about limits. Where a regex can only check the shape of something, such as a card number, a CNIC or an email address, the page says so in a visible caveat rather than claiming the value is valid or real.
  5. Corrected quickly. If you find a pattern that is wrong, a conversion that misbehaves or an explanation that is unclear, please send a correction. Fixes are added together with a new test case so the same mistake cannot come back.

Content last reviewed: 1 December 2026.

Where to start

Open the Playground and load one of the sample texts, try the Generator with a plain description, or begin the 30-lesson course. If you find a pattern that is wrong or a conversion that misbehaves, please tell us through the contact page; corrections are always welcome.