● runs entirely in your browser

Visual Regex Builder

Click building blocks to compose a pattern at your cursor position, with live match highlighting against your own sample text. For testing an existing regex instead, see the regex tester.

Character classes
Anchors
Quantifiers
Groups & alternation

Matches

How it works

Clicking a building block inserts that token directly at your cursor's position in the pattern field — tracked via selectionStart/selectionEnd — then the pattern is recompiled and run against your sample text on every change. With the global flag checked, it loops exec() calls and manually advances lastIndex after zero-length matches to avoid an infinite loop; without it, only the first match gets highlighted.

FAQ

Why do I need to check the "g" (global) box to see every match highlighted?
Without the global flag, JavaScript's regex engine only ever returns the first match from exec() — that's a property of the regex itself, not a limitation added by this tool, so the builder mirrors exactly how the pattern behaves in real code.
What happens if my pattern is invalid, like an unclosed bracket?
The RegExp constructor throws, and the tool catches it and displays the JavaScript engine's own error message instead of highlighting anything — the same error you'd see from new RegExp() in a browser console.

Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.

Say thanks — $3