JavaScript Regex Tester
Enter a JavaScript regular expression and test text to see matches, capture groups, and positions — live, in your browser. No upload required.
Pattern
Test Text
JavaScript Engine
Tests regex using the native JS engine in your browser. Regex behavior may differ from PHP (PCRE), Python re, or .NET engines.
Fully Private
Your pattern and test text are never sent anywhere. All matching runs locally in the browser.
Capture Groups
Numbered groups (Group 1, 2…) and named groups (?<name>…) are both shown per match.
How to test a JavaScript regex
- Enter your regular expression pattern in the pattern field (without the surrounding slashes).
- Toggle the flags you need —
g(global),i(case-insensitive),m(multiline) and more. - Paste your test text. Matches are highlighted and listed instantly with index positions and capture groups.
JavaScript regex only: This tool tests regular expressions using the native JavaScript engine in your browser. Behavior may differ from PHP (PCRE), Python re, Java, .NET, or other regex engines. Features like named capture groups with (?<name>…) are supported; look-behind in older browsers may vary.
Privacy — processed in your browser
Your patterns and test text never leave your device. All regex execution happens locally in the JavaScript engine built into your browser — no server calls, no data collection.
Frequently Asked Questions
Is this a JavaScript regex tester?
Yes. This tool uses your browser's native JavaScript RegExp engine. It is not PCRE, Python, or .NET regex. JavaScript regex shares most common syntax but differs in some features — lookbehind support, for example, was only added to JS in ES2018.
Does this upload my text?
No. Everything runs locally in your browser. Your pattern and test text are never sent to any server. This makes the tool safe for testing patterns against sensitive or confidential text.
Which regex flags are supported?
All standard JavaScript flags are supported: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dotAll — dot matches newlines), u (Unicode), and y (sticky). Flags are toggleable individually.
Why does my regex work here but not in PHP or Python?
JavaScript, PHP (PCRE), Python, and .NET each use different regex engines with different syntax for some features. For example, Python uses (?P<name>…) for named groups while JavaScript uses (?<name>…). PCRE also supports features like (*SKIP) and (*FAIL) that JavaScript does not. Always test in the target language.
Can I see capture groups and match positions?
Yes. Each match in the details panel shows the full match text, its character index range (start–end), and any numbered or named capture groups. Named groups defined with (?<name>…) are shown separately with their names.