Regex Tester

Test JavaScript regular expressions against your own text and see every match highlighted, with groups and positions listed. This tool uses JavaScript (ECMAScript) regex flavor only, the same syntax your browser and Node.js use.

Regular expression
/

/





Test text


Highlighted matches
(no content yet)
Match list

Write a pattern and some test text and matches appear automatically.

Runs locally in your browser. Nothing is uploaded.

What is Regex Tester?

Regex Tester is a free online tool for trying out regular expressions, the compact search patterns programmers use to find, validate, and extract text. A pattern like \d+ means “one or more digits,” [A-Z]+ means “one or more capital letters,” and ^\S+@\S+\.\S+$ is a rough shape for an email address. Instead of guessing whether a pattern works and running code to find out, you can type the pattern here, paste sample text, and watch every match light up instantly.

This tester uses JavaScript regex flavor only, the same engine built into every browser and Node.js. That matters because regular expression syntax is not fully identical across languages: features such as lookbehind, named groups, and unicode mode behave differently in Python, PHP, or Java. If you are writing JavaScript, a VS Code search, or a browser form validator, what you see here is exactly what your code will do. The flags control how matching behaves: g finds all matches instead of stopping at the first, i ignores upper and lower case, m makes ^ and $ match at each line boundary, s lets the dot match newlines, u enables full unicode handling, and y anchors matching to the current position.

How to use Regex Tester

First, type your pattern in the field between the slashes, then tick the flags you need or type them directly in the flags box. Next, paste or type your test text in the box below. Matches are highlighted automatically as you type, and the match list shows each match with its start and end index plus the value of every capture group, so you can check grouping and alternation at a glance. If a pattern is invalid, the status line shows the exact error message from the JavaScript engine, which usually points at the problem: an unclosed parenthesis, a bad escape, or a reversed quantifier range like {2,1}. Use the Load example button to start from a working pattern, and Clear to start over.

Frequently asked questions

Why does my pattern work here but not in Python or PHP? Different languages use different regex engines with small syntax differences. This tool deliberately implements JavaScript flavor only, so results are exact for JavaScript and close for most other engines, but constructs such as \p{…} unicode properties or lookbehind may need adjustment elsewhere.

What is an empty match? Patterns such as a* or \d? can match zero characters, so they produce an empty match at positions where nothing is present. The tool lists these honestly and marks them in the highlight preview, because silently hiding them would make debugging harder.

How many matches are shown? Up to 500 matches are collected and listed. That cap keeps the page responsive when a pattern matches almost everywhere in a long document; if you hit it, narrow the pattern or shorten the test text.

Is my test text sent anywhere? No. The pattern and the text never leave your device. Everything runs in your browser, which also makes the tool safe for testing patterns against private logs, code, or customer data.

Related tools

Runs locally in your browser. Nothing is uploaded. How our privacy works

© 2026 TinyLabTools · tinylabtools.com