What Is a Regex Tester?
The Regex Tester lets you build and debug regular expressions with instant feedback. Type a pattern and choose the flags (global, ignore-case, multiline, dotall), paste your test text, and every match is highlighted live as you type, with a running match count. It also lists numbered and named capture groups from the first match and includes a library of ready-made patterns — email, CPF, CEP, Brazilian phone, URL, IPv4 and dates — plus a quick reference of the most common syntax tokens. Everything uses your browser’s native JavaScript regex engine and runs locally, so your patterns and text stay private.
A regular expression (regex) is a sequence of characters that defines a search pattern. Regex testers let you write an expression and immediately see which parts of a text it matches, making it far easier to build and debug patterns before embedding them in code. Without an interactive tester, you must edit a script, run it, read output and repeat — a loop that a regex tester collapses into milliseconds.
Why your pattern doesn't match
A regex that returns nothing is rarely broken syntax — it is usually one of these behaviours doing exactly what it was told.
Greedy quantifiers swallowing too much
Against <b>one</b> and <b>two</b>, the pattern <.+> matches the whole line, not the first tag: + takes as much as it can and only gives back what it must. Add a question mark to make it lazy — <.+?> — and it stops at the first closing bracket.
An unescaped dot (or plus, or parenthesis)
A dot means "any character", so 3.14 also matches 3x14 and 3914. To match a literal dot, escape it: 3\.14. The same applies to + * ? ( ) [ ] { } ^ $ | and the backslash itself — inside a character class most of them lose their meaning, which is why [.] works too.
^ and $ anchored to the whole string
By default ^ means start of input and $ means end of input, so a pattern like ^error will only ever match if the very first line begins with it. Turn on the m flag and both anchors switch to start and end of each line, which is what you almost always want with log files.
\d and \w matching more than you expect
Without the u flag JavaScript's \w is strictly [A-Za-z0-9_], so it will not match an accented letter — a pattern built for names silently skips "José". Conversely, once you enable Unicode property escapes, \p{L} matches letters from every script, which may be more than a validator should accept.
Quantifiers at a glance
The difference between these four is where most unexpected match lengths come from. Assume the subject text is aaa.
| Pattern | Meaning | Matches in "aaa" | Note |
|---|---|---|---|
| a+ | One or more, greedy | aaa | Takes everything it can |
| a+? | One or more, lazy | a | Stops at the first success |
| a* | Zero or more, greedy | aaa | Can match nothing at all |
| a{2} | Exactly two | aa | Fixed counts are never greedy |
| a{1,} | Same as a+ | aaa | Ranges follow the same greedy rule |
Adding ? after any quantifier makes it lazy. This is the fix for the classic <.+> problem: <.+?> stops at the first closing bracket instead of the last.
Testing a Regex
- Type a regular expression and toggle the flags (g, i, m, s) you need.
- Paste text below — matches are highlighted instantly with a count.
- Inspect the capture groups, or click a common pattern to start from a template.
Pattern Testing is Local
Regular expression testing is performed entirely in your browser using JavaScript's regex engine. The patterns and test strings you provide are processed locally on your machine — no data is sent to external servers.