Regex tester
Try a pattern and see what it matches in your text.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Test JavaScript regular expressions against local text. Matches include indices and groups; a disposable worker enforces a two-second execution limit and caps the match list at 1,000.
How to use this tool
- Paste sample text into “Test text”, or load the example.
- Enter a JavaScript regular expression and choose its flags in Settings, then select “Test expression”.
- Inspect highlighted matches, positions and capture groups. A count of zero means the pattern found no match.
Supported inputs and limits
A pattern up to 4 KiB, sample text up to 256 KiB, a hard two-second worker limit and at most 1,000 matches. Only JavaScript flags i, m, g, s, u and y are accepted.
Worked example
Example input
ab12 cd34
Example options
{
"pattern": "(\\d+)",
"flags": "g"
}Example output
{
"matches": [
{
"index": 2,
"end": 4,
"text": "12",
"groups": [
"12"
],
"named": {}
},
{
"index": 7,
"end": 9,
"text": "34",
"groups": [
"34"
],
"named": {}
}
],
"capped": false,
"count": 2
}When something does not work
Correct the reported syntax or range and run again. Formatting is not execution: scripts, SQL, expressions and pasted markup do not run against your system or a remote service.
Frequently asked questions
Are my files uploaded?
No. Files and tool input are processed in your browser. Moving around the site can keep a temporary workspace in the same tab. Refreshing or closing the tab clears it, so download results you want to keep.
What should I check in this result?
Test JavaScript regular expressions against local text. Matches include indices and groups; a disposable worker enforces a two-second execution limit and caps the match list at 1,000.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.
CSS formatter
Tidy the indentation and line breaks in your CSS.