Regex Tester

Test regular expressions against text in real time. Matches highlight instantly as you type.

/ /
Common patterns — click to load
Quick Answer

Enter your regex in the Pattern field (no surrounding slashes), paste your test string below it, and matches highlight instantly. Use the flag checkboxes to enable global matching (g), case-insensitive matching (i), or multiline mode (m). Captured groups are shown separately.

What is a regex tester?

A regex tester lets you write a regular expression and immediately see which parts of your test text it matches. This is much faster than running code every time you adjust a pattern. The tester above highlights matches in real time as you type and shows each match's position and any captured groups.

Regex flags explained

g (global) finds all matches instead of stopping at the first. i makes matching case-insensitive. m makes ^ and $ match the start/end of each line. s (dotAll) makes . match newlines as well. In JavaScript, these map directly to the RegExp flags.

Capture groups

Parentheses in a regex create capture groups. For example, (\d{4})-(\d{2})-(\d{2}) on the string "2026-06-21" captures three groups: "2026", "06", and "21". Non-capturing groups use (?:...) syntax. Named groups use (?<name>...).

Frequently asked questions

What is a regular expression?

A regular expression (regex) is a pattern that defines a search. \d+ matches one or more digits. [a-z]+ matches one or more lowercase letters. Regex is supported in virtually every programming language.

What do the regex flags do?

g finds all matches. i ignores case. m makes ^ and $ match line starts/ends. s makes . match newlines. Combine them: gi finds all case-insensitive matches.