Regex Tester

Test regular expressions with live highlighting, match groups, and a pattern cheatsheet.

No data leaves your browser
Pattern
/
Test String
Common Patterns — click to use

Frequently Asked Questions

Is the regex tester free?

Yes, completely free with no account or signup required.

Which regex flavor is used?

JavaScript's built-in RegExp (ECMAScript standard) with flags: global (g), case-insensitive (i), multiline (m), and dotAll (s).

What features are included?

Live match highlighting, capture group extraction, match count, a regex cheat sheet, and one-click patterns for common use cases.

What is a regular expression?

A regular expression (regex) is a sequence of characters that defines a search pattern. It is used to find, match, validate, and transform text in programming languages, editors, and command-line tools.

How do I test a regex online?

Enter your pattern in the Pattern field and your test string in the Text field. Matches are highlighted in real time as you type.

What are regex flags?

Flags modify how the pattern matches. g (global) finds all matches instead of stopping at the first. i (case-insensitive) treats uppercase and lowercase as equal. m (multiline) makes ^ and $ match line starts/ends. s (dotAll) makes . match newlines.

What is the difference between greedy and lazy quantifiers?

Greedy quantifiers (*, +, {n,m}) match as much as possible. Lazy quantifiers (*?, +?, {n,m}?) match as little as possible. For example, <.+> greedily matches a whole string, while <.+?> lazily matches the shortest possible span.

What is a capture group?

A capture group is part of the pattern wrapped in parentheses (). The matched text is extracted separately. Named groups use (?<name>...) syntax.

How do I match an email address with regex?

A common email pattern is [a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}. Click the Email pattern in the cheat sheet to use it instantly.

What is a lookahead in regex?

A lookahead asserts that a pattern must (or must not) follow the current position without consuming characters. (?=...) is a positive lookahead and (?!...) is a negative lookahead.

How do I match the start or end of a line?

Use ^ to match the start and $ to match the end. Enable the m flag to make ^ and $ match the start and end of each individual line rather than the whole string.

More Developer Tools