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.
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 — freeClick any pattern to load it into the tester above. Then paste your own text to see it in action.
A condensed reference for the most-used regular expression syntax. All patterns in this tester follow JavaScript's ECMAScript regex engine.
| Token | Meaning | Example |
|---|---|---|
| . | Any character except newline (add s flag to match newlines) | c.t → "cat", "cut" |
| \d | Any digit 0–9 | \d\d\d → "404" |
| \w | Word character [a-zA-Z0-9_] | \w+ → "hello_world" |
| \s | Whitespace (space, tab, newline) | \s+ → gaps between words |
| \b | Word 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|b | Alternation (a or b) | cat|dog |
| *? +? | Lazy quantifier (shortest match) | <.+?> matches first tag only |
| Flag | Name | Effect |
|---|---|---|
| g | Global | Find all matches, not just the first |
| i | Case insensitive | Hello matches "hello", "HELLO", "HeLLo" |
| m | Multiline | ^ and $ match start/end of each line, not just the whole string |
| s | Dot-all | . matches newline characters too |