Skip to content

Test a regular expression

Test a regular expression against a text and get every match with spans and capture groups, under a hard 1.5 second time budget.

regextestText

Upload

Files (0–1)
One text document (code, JSON, Markdown, logs), up to 1 MB, or paste the text below.
Paste the text instead of uploading a file. The same runs, caps and time budget apply to pasted text.

Options

Regular expression Re-style syntax plus the regex module's extras. A pattern that does not compile is refused with the engine's message, trimmed.
Pattern flags
ignorecase folds letter case; multiline makes ^ and $ work per line; dotall makes . match newlines; ascii restricts escapes to ASCII; verbose ignores whitespace and comments in the pattern.
Questions people ask
Which regex syntax does this tool use?
Python's regex engine: re-style syntax plus extras such as atomic groups and unicode property escapes. It is not grep, PCRE or POSIX, and constructs differ between dialects; a POSIX character class or a PCRE-only verb may mean something else here or mean nothing at all. The report repeats this so the result is never mistaken for a portable dialect.
What does the 1.5 second budget mean for me?
Every matching call is capped at 1.5 seconds. If a pattern runs longer, the job refuses with a clear timeout message instead of hanging, and the suggestion is simply to narrow the pattern. Classic trouble patterns such as nested quantifiers on large texts are the usual cause.
Why do results stop at 2,000 matches?
So that one pattern cannot flood the report. The full count keeps going up to 100,000 and is reported as the headline number, while the listing shows the first 2,000 in order. When the scan cap is reached the report says exactly that, so you always know how much of the text was actually examined.
How are capture groups reported?
Per match, up to twenty groups, each with its name when the pattern names it, or a plain g1, g2 label otherwise. A group that did not participate is reported as not captured rather than shown as an empty string, which would read as a real value.
Does it read files or pasted text?
Both. Upload a text document up to 1 MB, or paste up to 256 KiB. Pasted text runs through the same caps, the same budget and the same report, and which one you pick changes nothing about the result.
What happens to my files?
The upload is removed as soon as processing finishes; the report stays downloadable for about 10 minutes, then it is deleted automatically.