Regex Companion

Learn, write, and debug regular expressions — interactively, in your browser.

Regular expressions are powerful but notoriously hard to learn. Regex Companion is an interactive tool that lets you write a regex, paste your test text, and immediately see what matches — no guessing, no trial-and-error in the dark.

Whether you're a developer who keeps forgetting whether + or * is greedy, or a student taking their first steps into pattern matching, Regex Companion explains what your regex does as you type and highlights matches in real time.

Free. Offline. No sign-up. Available in English and Dutch.

User Manual

Overview

Regex Companion is a browser-based regular expression learning and testing tool. It uses the native JavaScript RegExp API, so patterns behave exactly as they do in JavaScript environments. No data is sent anywhere — everything runs locally in your browser.

Language

The interface is available in English and Nederlands (Dutch). Use the language toggle at the top of the page to switch.

Core Workflow

1. Write your regex

Enter your regular expression in the pattern field. The tool validates your pattern in real time and shows an error if the syntax is invalid.

2. Set flags

Common regex flags you can apply:

3. Paste your test text

Type or paste the text you want to match against in the input area. Matches are highlighted immediately.

4. Review matches

The tool shows all matches found, including capture groups. Use this to verify your pattern does exactly what you intend before using it in code.

Learning Features

Regex Companion is designed as a teaching tool. As you work, the app explains what each part of your regex does — making it useful not just for testing but for building your understanding of regular expression syntax.

Common Regex Syntax Reference

PatternMeaning
.Any character except newline
*Zero or more of the preceding
+One or more of the preceding
?Zero or one (optional)
^Start of string (or line with m flag)
$End of string (or line with m flag)
[abc]Character class: a, b, or c
[^abc]Any character except a, b, or c
(abc)Capture group
(?:abc)Non-capturing group
\dAny digit (0–9)
\wAny word character (letters, digits, _)
\sAny whitespace character
\bWord boundary

Privacy

Regex Companion uses no external libraries and sends no data anywhere. Your patterns and test text remain in your browser only. Previous sessions may be saved in localStorage and IndexedDB for convenience.