Free tool · TextForge

Regex Tester

Type a regular expression and paste your test string to see matches highlighted in real time. Inspect capture groups and match positions. Runs entirely in your browser — nothing is sent to any server.

/ /
0 characters
Matches
Unique
Groups
0
Characters

Frequently asked questions

What regex flavor does this tool use?

It uses JavaScript's native regex engine (ECMAScript), the same one that runs in Chrome, Firefox, and Node.js — so patterns you test here behave the same way in your code.

Does it support regex flags like g, i, m, and s?

Yes, you can toggle common flags to test global matching, case-insensitivity, multiline mode, and dot-all behavior.

Can I test against multiline text?

Yes, paste any block of text into the test string field — matches are highlighted in real time as you edit the pattern or the text.

Is my test data sent anywhere?

No, matching runs entirely in your browser via JavaScript's built-in RegExp — nothing is sent to a server, so it's safe to test against logs or private data.

Need regex find-and-replace directly in your browser on any text you're working with? TextForge runs as a Chrome extension — paste text, apply regex, extract or transform results, all locally.

Try TextForge — free

Quick Patterns

Click any pattern to load it into the tester above. Then paste your own text to see it in action.

Regex Quick Reference

A condensed reference for the most-used regular expression syntax. All patterns in this tester follow JavaScript's ECMAScript regex engine.

TokenMeaningExample
.Any character except newline (add s flag to match newlines)c.t → "cat", "cut"
\dAny digit 0–9\d\d\d → "404"
\wWord character [a-zA-Z0-9_]\w+ → "hello_world"
\sWhitespace (space, tab, newline)\s+ → gaps between words
\bWord boundary\bcat\b matches "cat" not "catch"
^Start of string (or line with m flag)^\d → line starting with a digit
$End of string (or line with m flag)\d$ → line ending with a digit
*0 or more (greedy)ab* → "a", "ab", "abbb"
+1 or more (greedy)ab+ → "ab", "abbb" (not "a")
?0 or 1 (optional)colou?r → "color" or "colour"
{n,m}Between n and m times\d{2,4} → 2 to 4 digits
[abc]Character class (any of a, b, c)[aeiou] → any vowel
[^abc]Negated class (anything except a, b, c)[^\d] → non-digit
(abc)Capture group — stored as $1, $2…(\d{4})-(\d{2}) → two groups
(?:abc)Non-capturing group(?:foo|bar)baz
a|bAlternation (a or b)cat|dog
*? +?Lazy quantifier (shortest match)<.+?> matches first tag only

Flags

FlagNameEffect
gGlobalFind all matches, not just the first
iCase insensitiveHello matches "hello", "HELLO", "HeLLo"
mMultiline^ and $ match start/end of each line, not just the whole string
sDot-all. matches newline characters too