OneFirewall Alliance

Regex Tester

Test regular expressions in real-time — highlight matches, inspect groups, replace and validate

Enter a regular expression and sample text to see matches highlighted as you type, inspect capture groups, test flags and try search-and-replace before using the pattern in your code. More free security tools.

Presets
Email
URL
IPv4
IPv6
UUID
Phone
Date (ISO)
JWT
Hex Colour
SemVer
CVE ID
MD5 Hash
/
/
g
i
m
s
u
Highlighted Matches
Replace
How It Works & Why It Matters

Regular expressions are deceptively easy to get subtly wrong — a greedy quantifier that backtracks catastrophically, a capture group that shifts index when you add a new group earlier in the pattern, or a flag you forgot to set. This tester runs your pattern against the browser's native RegExp engine (the same engine your JavaScript code will use), so what you see here is what you'll get in production.

Matches highlight live as you type, capture groups are broken out individually so you can confirm you're referencing the right one, and the search-and-replace panel lets you test a substitution pattern — including backreferences — before you commit it to code.

Need help building secure input validation and WAF rules for your applications?

If you like this tool, Speak with OneFirewall

What the Regex Tester does

Regular expressions power log parsing, input validation, SIEM rules and detection signatures, and a small mistake can miss attacks or match far too much.

Test a pattern against sample text with live highlighting, inspect capture groups, try flags and run search-and-replace before using it in code.

How to use it

  1. Enter your pattern. Type the regular expression and choose flags such as global, case-insensitive or multiline.
  2. Add sample text. Paste log lines or input samples. Matches are highlighted as you type.
  3. Inspect and refine. Check capture groups and try replacements until the pattern matches exactly what you intend.

Frequently asked questions

Why does my regex match too much?

Quantifiers like .* are greedy by default. Use lazy quantifiers (.*?), anchors (^ and $) or more specific character classes.

What is catastrophic backtracking?

Some patterns with nested quantifiers take exponential time on certain inputs, which attackers can exploit to cause denial of service (ReDoS). Avoid nested repetition such as (a+)+.

Which regex flavour does this use?

It uses your browser's JavaScript regular expression engine, so behaviour can differ slightly from PCRE, Python or Go.

More free tools: OneFirewall Free Tools · Terms explained: Glossary