What is a regular expression?

A regular expression describes a pattern to find in text. This tester uses JavaScript RegExp syntax and the browser engine, so features and flags may differ from PCRE, Python, Java, or .NET.

JavaScript regex flags

g finds successive matches, i ignores letter case, m changes line anchors, s lets a dot include line breaks, u enables Unicode-aware parsing, and y performs sticky matching from the current index.

Capture groups and replacement

Parentheses capture parts of a match. JavaScript replacements can reuse numbered groups with $1, the complete match with $&, or named groups with $<name>. The replacement preview does not modify the source editor.

Catastrophic backtracking

Some nested repetitions can make a regex engine explore an excessive number of paths. Evaluation here runs in a disposable Web Worker with input limits and a strict timeout, so an expensive expression can be terminated without freezing the interface.

Frequently asked questions

Does this find overlapping matches?

No. Results follow standard JavaScript matching behavior and do not invent overlapping matches.

Is the pattern explanation generated by AI?

No. It is a deterministic breakdown of common tokens and labels unfamiliar constructs as advanced rather than guessing.