Regex Tester

Write a pattern and test it against any text. All matches are highlighted live with index and group info.

Runs in your browser
Test String

How to Use the Regex Tester

  1. Enter your regular expression pattern in the pattern field (without surrounding slashes).
  2. Set the desired flags: g (global), i (case-insensitive), m (multiline), or s (dotAll).
  3. Paste or type your test text in the text area below.
  4. All matches are highlighted in real time as you type — match count, indices, and capture groups are shown below the text.

About the Regex Tester

Regular expressions are a powerful pattern-matching language used across virtually every programming language. This tester uses JavaScript's native RegExp engine, making it ideal for testing patterns destined for Node.js, browser JavaScript, or TypeScript projects. Matches are highlighted directly in the text as you type, with no need to click a button. The tool displays each match's start index, captured groups, and total match count. All testing happens locally in your browser — no data is transmitted anywhere.

Frequently Asked Questions

What regex flavour does this support?
This tester uses the JavaScript (ECMAScript) regex engine. It supports standard features including character classes, quantifiers, anchors, lookahead/lookbehind assertions, named capture groups, and Unicode property escapes. Note that some features from PCRE (PHP, Python) or RE2 (Go) may differ slightly.
What do the g, i, m, s flags do?
g (global) finds all matches instead of stopping at the first. i (case-insensitive) makes the pattern match regardless of letter case. m (multiline) makes ^ and $ match the start and end of each line instead of the entire string. s (dotAll) makes the . character match newline characters as well.
Why isn't my regex matching anything?
Common reasons: missing the g flag (so only the first match is found), not escaping special characters like . * + ? ( ) [ ] { } ^ $ | \ when you want them literally, incorrect character class syntax, or mismatched quotes in string patterns. Check the match count display for error messages.
Is there a limit on text length?
There is no imposed limit. The constraint is your browser's JavaScript engine. Very long texts (millions of characters) with complex patterns involving catastrophic backtracking could cause slowness, but typical use cases work instantly.