Dev Tools

Regex Tools

Test, extract, replace, and explain JavaScript regular expressions. Flavor differences vs PCRE are called out.

5 tools · 100% browser-based · No uploads · No signup

About these Regex tools

Regex tools test, extract, replace, and explain patterns using the JavaScript regular expression engine. The cheat sheet is a syntax map with examples. If you live in Python, Go, or POSIX, expect small differences (lookbehind, named groups, Unicode).

A regex is a compact program. Catastrophic backtracking can freeze a tab on crafted input. Keep tests on representative samples, not a 50 MB log in one shot.

Tools in this category

How these tools run in your browser

The tester compiles new RegExp(pattern, flags) and runs it on your text. Explainer tokenizes a common subset of JS regex syntax. It will not fully parse every exotic construct. Replacer uses String.prototype.replace semantics.

Common Use Cases

  • Debug a pattern against a sample log line with live highlights
  • Extract all capture groups to JSON or CSV
  • Preview a replace with $1 backreferences before you run it in an editor
  • Read a dense pattern token by token
  • Look up anchors, character classes, and flags

Common Mistakes

Greedy vs lazy quantifiers change matches in ways that look "random" until you highlight them.
Dot does not match newlines unless the s flag is on.
JavaScript has no POSIX character classes like [[:digit:]].
Pasting untrusted regex plus untrusted text is a ReDoS risk in any language, including this page.

Frequently Asked Questions

Why does this match in regex101 (PCRE) but not here?

Flavor mismatch. Switch regex101 to ECMAScript or rewrite lookbehind and possessive quantifiers.

Are matches the same as grep -E?

grep is POSIX or PCRE depending on flags. Anchors and word boundaries differ. Test in the environment that will run the pattern.

Can you generate a regex from examples?

Not automatically. Write the pattern and test it here. Generated regex from a few examples is usually wrong on the next input.