Tool reference
Regex Tester
alphaTest JavaScript regular expressions against real input, inspect match positions and capture groups, preview replacements, and share the current session through the URL.
Quickstart
Use this when you want the shortest path from input to a useful result.
Enter a pattern in the expression field and toggle the flags you need.
Paste sample text into the Test Input editor.
Review the highlighted matches or switch to Replace Mode to preview substitutions.
Best for
Common situations where this tool fits naturally into the workflow.
Common tasks
Concrete ways this tool is typically used in day-to-day workflows.
Inspect capture groups
Click a highlighted match or open Match Inspector to see numbered and named captures, line, column, and surrounding context.
Preview replacements safely
Switch to Replace Mode and use replacement syntax like `$1` or `$<name>` before applying the pattern in code.
Start from a known template
Open Utilities, load a template such as Semantic Versions or Email Parts, then adapt it to your own input.
Examples
Real inputs and outputs that show how the tool behaves.
Match semantic versions
The Semantic Versions template captures major, minor, patch, and optional prerelease parts.
Pattern and input
/\bv?(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?\b/g next release: v2.4.0 rollback target: 1.9.12-beta.3
What you see
Two matches are highlighted. Match Inspector shows captures for major, minor, patch, and prerelease.
Preview a replacement
Replace Mode shows the rewritten output without changing the source input.
Pattern, replacement, input
Pattern: ([\w.+-]+)@([\w.-]+\.[A-Za-z]{2,})
Replacement: user=$1 domain=$2
ops@devforge.ioReplace output
user=ops domain=devforge.io
Handle invalid patterns
If the pattern does not compile, the preview stays intact and the tool surfaces the JavaScript RegExp error.
Pattern
(
Error
Unterminated group
Features
What this tool includes and what each capability is for.
Match Mode
Highlights matches inline and lets you move between them while keeping the selected match in view.
Replace Mode
Shows replacement output live and supports numbered as well as named capture references.
Flag Toggles
Switches `g`, `i`, `m`, `s`, `u`, and `y` on or off without rewriting the raw pattern string.
Match Inspector
Displays value, index, line, column, local context, and captures for the selected match.
Reference and Templates
Keeps syntax reminders and starter templates in the Utilities modal so the main workspace stays focused.
Shareable URLs
Encodes the current pattern, input, replacement, flags, and mode into the URL after a short debounce.
Workflow
Follow this path to get from input to output quickly.
Enter a pattern and toggle the flags that match the behavior you want.
Paste sample text into the editor on the left.
Inspect highlighted matches in Match Mode or preview rewritten text in Replace Mode.
Open Utilities for templates or syntax reference when needed.
Copy the share link if someone else needs to reproduce the same session.
Caveats and tips
Things to keep in mind before relying on the output in a larger workflow.
Caveats
- This tool uses the JavaScript RegExp engine, so behavior follows browser regex semantics rather than PCRE or RE2.
- Match collection stops after 250 results to keep the preview responsive.
- Without `g` or `y`, the analysis section only reports the first match.
Tips
- Use named capture groups when the match needs to be explained to someone else through Match Inspector.
- Copy Share Link after reproducing a bug so another developer opens the same pattern, flags, mode, and input state.
- If a pattern can match an empty string, the tool still advances safely, so check zero-width matches in Match Inspector when results look odd.