Developer

Regex Tester

Write and test regular expressions with real-time match highlighting, group capture display, and instant feedback. Supports all standard JavaScript regex flags.

/ /
Enter a pattern and test string to see matches.
Quick patterns — click to use

Click any pattern to load it into the tester.

What are regular expressions?

A regular expression (regex) is a sequence of characters that defines a search pattern. They're used in virtually every programming language for searching, validating, and transforming text — from email validation to log parsing to find-and-replace.

Common regex flags

g (global) — find all matches, not just the first. i (case-insensitive) — treat uppercase and lowercase as equal. m (multiline) — ^ and $ match start/end of each line, not just the whole string. s (dotAll) — makes . match newlines too.

Why does my regex match too much?

This is usually a greedy quantifier issue. By default, * and + match as many characters as possible. Add a ? after them (.*? or .+?) to make them lazy — they'll match as few characters as possible.

How do I match a literal dot or bracket?

Escape it with a backslash: \. matches a literal dot, \[ matches a literal opening bracket. Unescaped dots match any character.

Does this tool send my text anywhere?

No. All regex processing runs locally in your browser using the JavaScript RegExp engine. Nothing is sent to a server.