Regex Tester – Test Regular Expressions with Live Highlighting

//g

Calcon's free Regex Tester lets you write and test JavaScript regular expressions with real-time match highlighting. See every match position, named group values, and use quick-reference chips for common patterns — all without leaving the page.

Regex Flag Reference

FlagNameEffect
gGlobalFind all matches, not just the first
iIgnore caseMatch upper and lowercase equally
mMultiline^ and $ match start/end of each line
sDot all. matches newline characters too

Frequently Asked Questions

What is a regular expression?

A regular expression (regex) is a pattern that describes a set of strings. For example, \d{3}-\d{4} matches phone formats like 555-1234. Regex is supported in JavaScript, Python, Java, and nearly every programming language and text editor.

What do the g, i, m, s flags do?

g (global) finds all matches instead of stopping at the first. i makes matching case-insensitive. m makes ^ and $ match line boundaries. s (dotAll) lets . match newline characters.

What are named capture groups?

Named groups use (?<name>...) syntax. For example, (?<year>\d{4})-(?<month>\d{2}) captures date parts by name. Named groups appear in the groups table below the match list and make your regex easier to read and maintain.

How do I escape special characters?

Special regex characters (. * + ? ^ $ { } [ ] | ( ) \) must be escaped with a backslash to match them literally. For example, to match a period: \. To match a dollar sign: \$. To match a backslash itself: \\.

Related Developer Tools