BeYourTools

Developer Tools

Regex Tester

Regex not matching and you can't see why? Paste your pattern and test string - matches light up live while you debug.

Flags
Common patterns
Regex cheatsheet

Character classes

.
Any character except newline
\d / \D
Digit / non-digit
\w / \W
Word char (A-Za-z0-9_) / non-word
\s / \S
Whitespace / non-whitespace
[abc]
Any of a, b, c
[^abc]
Anything except a, b, c
[a-z]
Range a through z

Quantifiers

*
0 or more (greedy)
+
1 or more (greedy)
?
0 or 1
{n}
Exactly n
{n,}
n or more
{n,m}
Between n and m
*? +? ??
Lazy versions: match as little as possible

Anchors

^
Start of string (or line with m flag)
$
End of string (or line with m flag)
\b
Word boundary
\B
Not a word boundary

Groups

(abc)
Capture group: numbered 1, 2, 3…
(?:abc)
Non-capturing group
(?<name>abc)
Named capture group
a|b
Alternation: a or b
\1
Backreference to group 1
(?=abc)
Positive lookahead
(?!abc)
Negative lookahead
Private by design: This tool runs entirely in your browser. Nothing you type or upload is sent to a server.

How to use Regex Tester

  1. Enter your pattern. Type the regex without slashes, then toggle flags (g, i, m, s, u) as needed.
  2. Add test text. Paste the string you're matching against - logs, form input, whatever it is.
  3. Inspect matches. Matches highlight in the text; the panel below lists each match with its capture groups.
  4. Try a preset. Stuck? Load a common pattern (email, URL, date…) and adapt it.

Regex Tester Features

  • Live match highlighting
  • Capture group listing per match
  • Flag toggles (g i m s u y)
  • Common-pattern presets
  • Built-in regex cheatsheet
  • Clear invalid-pattern errors

Regex Tester Frequently asked questions

JavaScript (the same engine as your browser). Most syntax transfers to Python, Java and PCRE, but lookbehind and some advanced features differ between flavors - always re-test in your target language.
The error message shows the browser's exact complaint - usually an unclosed bracket, a stray backslash, or a bad quantifier. Fix it in the pattern box and highlighting resumes instantly.
g (global) finds all matches instead of stopping at the first. m (multiline) makes ^ and $ match at line boundaries, not just the string's start/end. They're independent - you often want both.
Parentheses create numbered groups. Each match row expands to show group 1, 2, 3… with their captured text - use (?:…) for non-capturing groups when you don't need the value.
In this tester, a runaway pattern just freezes your tab briefly - close it if needed. In production code, avoid nested quantifiers like (a+)+ and prefer atomic groups or possessive quantifiers where your flavor supports them.