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 sequence of characters that defines a search pattern. It is used to find, match, and replace text. For example, the pattern \d{3}-\d{4} matches phone number formats like 555-1234. Regex is supported in JavaScript, Python, Java, and almost every programming language.

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

g (global): find all matches, not just the first. i (case-insensitive): match uppercase and lowercase equally. m (multiline): makes ^ and $ match the start/end of each line, not just the string. s (dotAll): makes the . character match newlines as well as regular characters.

What are named capture groups in regex?

Named capture groups let you label parts of a match using the syntax (?<name>...). For example, (?<year>\d{4})-(?<month>\d{2}) would capture the year and month from a date string as named properties. Named groups make your regex more readable and allow accessing match parts by name rather than by index.

How do I escape special characters in a regex?

Special characters in regex (. * + ? ^ $ { } [ ] | ( ) \) must be escaped with a backslash if you want to match them literally. For example, to match a period, use \. (not just .) because . in regex means "any character". To match a dollar sign, use \$.

Related Developer Tools

Subscribe to the Calcon newsletter

Get new calculators, tools, and practical guides delivered to your inbox. No spam — unsubscribe anytime.