A regular expression is a sequence of characters that defines a search pattern. Regex is used to match, find, and replace text based on patterns rather than exact strings, and is supported by most programming languages including JavaScript, Python, Go, and Java.
Each language ships its own regex engine with its own syntax quirks. For example, Python's re module names capture groups with (?P<name>...), while JavaScript, Go (RE2), and Java use (?<name>...). Backreference syntax, lookbehind support, and Unicode handling also vary. This tool lets you test your pattern against the real engine for each language instead of guessing.
Paste your input text on the left, enter your pattern in the Expression box, choose a language, and click Apply. The tool runs your pattern using that language's actual regex engine and shows each match, its index, and any capture groups.
A positional group is captured with plain parentheses like (foo) and is referenced by its position (1, 2, 3...). A named group, written as (?<name>foo) (or (?P<name>foo) in Python), is referenced by name instead, which makes complex patterns easier to read and maintain.