NewPlus, API and MCP are live — run 175 tools from your own stack.
100www

Tool 211 · C06 · Encoding / Dev · Updated Nov 2026

Regex Tester

Test a JavaScript regular expression live, with match groups, a replace preview and a plain-language explanation.

Browser Free No sign-up
How it works
100www.dev/tools/regex-tester?v=%5Ba-z%5D%2B
//
Flags
Result6 matches
100www makes DNS, SSL and email checks easy.
#IndexMatchGroups
13www—
27makes—
322and—
426email—
532checks—
639easy—

Runs with your browser's JavaScript RegExp engine. Matches, groups and replacement are computed locally; the text is not uploaded.

What it does

A regular expression tester lets you write a pattern, run it against sample text and see exactly what matched, which groups captured what, and where the engine stopped. This one uses the browser's JavaScript engine, so the behaviour you see is the behaviour your code will get.

How it works

Patterns are compiled with the JavaScript RegExp constructor. Flags change everything: g finds all matches, i ignores case, m makes ^ and $ match line boundaries, s lets . match newlines, and u enables Unicode mode, which is required for property escapes and astral characters.

Capture groups are numbered by the order of their opening parenthesis. Named groups use (?<name>…), lookaheads (?=…)/(?!…) assert without consuming, and lookbehinds (?<=…)/(?<!…) depend on engine support — JavaScript supports them in current browsers but older runtimes may not.

The replace preview applies the pattern with the chosen flags. Replacement strings interpret $1, $&, $<name> and $$ as references. A pattern that works in match mode can behave differently in replace mode when the global flag is off.

Catastrophic backtracking is the failure mode to watch for. Nested quantifiers such as (a+)+ against a long non-matching string can take exponential time and freeze the tab. If a pattern feels slow, rewrite it to avoid ambiguity rather than adding a timeout.

Regular expressions are not parsers. HTML, JSON, URLs and email addresses have grammars that regex can approximate but not validate reliably. Use the tester for extraction and simple checks, and a real parser where correctness matters.

When to use it

  • Check which capture group holds the value you need before writing code.
  • Verify that a pattern anchors correctly and does not match a substring by accident.
  • Test a replacement template with $1 and named groups.
  • Reproduce a catastrophic backtracking case before shipping a validation rule.

Glossary

Flag
A modifier such as g, i, m, s, u or y that changes matching behaviour.
Capture group
Parentheses that remember the text they matched, referenced as $1 or by name.
Lookaround
A zero-width assertion that checks context without consuming characters.
Backtracking
The engine retrying alternatives after a failed path, which can explode in cost.
ReDoS
Regular expression denial of service: a pattern whose worst case is exponential.

Frequently asked questions

Which regex flavour is used?+

JavaScript, as implemented by your browser. Python, PCRE and RE2 differ in lookbehind support, named-group syntax and Unicode behaviour, so a pattern that works here may need changes elsewhere.

Why does my pattern only match once?+

Add the g flag. Without it, match returns the first result only. The replace preview also replaces the first occurrence unless g is set.

Why is the page slow with a long input?+

Likely catastrophic backtracking. Nested quantifiers and ambiguous alternations can take exponential time. Simplify the pattern or anchor it; a timeout only hides the problem.

Can I validate email or HTML with this?+

Approximate checks are possible, but both grammars are more complex than they look. Email validation should at minimum check the domain and send a confirmation; HTML should be parsed.

Does the text I paste leave my browser?+

No. Matching runs locally in JavaScript. Nothing is uploaded or stored by 100www.

API & MCP

No API endpoint

This tool runs entirely in your browser. It is not available over the REST API or MCP.

Shareable result

https://100www.dev/tools/regex-tester?v=%5E%5Ba-z%5D%2B%24

100www

100www engineering

Editorial

Reviewed by Steve · · Report an error

Tested from the 100www probe network; results vary by location and network.