Developer Tool
Online Regex Tester & Checker
Free online regex tester for JavaScript regular expressions. Live match highlighting, capture group inspection, and match details — runs entirely in your browser, no server.
Paste any text and see which parts match your pattern, highlighted in real time.
What is a Regex Tester?
A regex tester (regular expression tester) is a tool that lets you write a pattern and immediately see which parts of a text string match. Instead of running code in a terminal or browser console, you get live feedback as you type — matches are highlighted in real time, capture groups are displayed, and errors in your pattern are reported instantly.
This free online regex tester uses JavaScript's ECMAScript engine — the same engine that runs in every browser and in Node.js. Everything runs locally in your browser; no text or patterns are ever sent to a server.
How to Test a Regex Online
- 1.Enter your regular expression in the Pattern field. You can also pick a pre-built pattern from the Patterns dropdown (email, URL, UUID, and more).
- 2.Toggle flags as needed —
gfor global,ifor case-insensitive,mfor multiline. - 3.Paste your test string in the left panel. Matches highlight live in the right panel, each capture group in its own colour.
- 4.Check Match Details below for the position, line number, full match, and individual capture group values.
- 5.Switch to the Replace tab to preview substitutions. Use
$1,$2or$<name>for named groups.
Common Regex Patterns Explained
Here are the most frequently used regular expression patterns and what they match:
- ▸
[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}— matches a valid email address. - ▸
https?:\/\/[^\s]+— matches a URL starting with http or https. - ▸
\d{4}-\d{2}-\d{2}— matches a date in YYYY-MM-DD format. - ▸
#(?:[0-9a-fA-F]{3}){1,2}— matches a hex color code like#fffor#f43f5e. - ▸
\b\w+\b— matches every individual word in a string.
Use the Patterns dropdown in the tester above to load any of these instantly.
JavaScript Regex vs PCRE
This tool uses the JavaScript (ECMAScript) regex engine — the same one used in browsers, Node.js, and TypeScript. If you are writing regex for Python, PHP, Ruby, or Nginx, be aware of these differences:
- ▸PCRE (PHP, Python
re, C, Nginx) supports possessive quantifiers (a++), atomic groups ((?>...)), and\K— none of which exist in JavaScript. - ▸JavaScript supports named capture groups (
(?<name>...)), lookahead, lookbehind, and theu(Unicode) ands(dotAll) flags.
For JavaScript, TypeScript, or Node.js regex — this is the right tester. For other languages, the patterns are largely compatible but test in the target environment before deploying.