Regex Tester
Test regular expressions.
Test regular expressions.
How to use Regex Tester
- Type your regular expression into the pattern field
- Toggle the global, ignore-case, multiline, and dotall flags
- Paste test text to see matches highlighted with capture groups
About Regex Tester
Type a regular expression, paste a test string, and watch every match light up as you edit. This online regex tester highlights hits directly inside your text, lists each one with its character index and capture groups, and keeps a running match count at the top. Toggle the global, ignore-case, multiline, and dotall flags to see how each one changes the result, and if your pattern has a syntax error you get a plain-language message instead of a broken page.
The engine behind it is JavaScript's built-in RegExp, so it doubles as a JavaScript and Node.js regex tester and matches exactly what runs in the browser. Most core syntax — character classes, quantifiers, anchors, lookaheads, and numbered or named groups — is shared with Java, Python, C#/.NET, and Perl, so patterns written for those languages usually behave the same way here; the differences tend to sit in flag letters, a few escape shortcuts, and lookbehind support, which is worth checking before you copy a pattern between languages.
There is no sign-up, no ads, and no limit on how many patterns or strings you test. Everything runs locally in your browser's own regex engine, so your pattern and test data never leave your device and nothing is ever uploaded to a server.
Frequently asked questions
- Is this regex tester free to use?
- Yes, it is 100% free with no account, no sign-up, and no usage limits. Test as many patterns and strings as you like.
- Is this an online, web-based regex tester?
- Yes. It is a browser tool, so there is nothing to install and nothing to download. Open the page, type a pattern, and it works on any device with a modern web browser.
- Is my data uploaded anywhere?
- No. The tool runs entirely in your browser using JavaScript's built-in regular expression engine. Your pattern and test string never leave your device and are never sent to any server.
- Which regex flags are supported?
- You can toggle the four most common flags: g (global, find all matches), i (ignore case), m (multiline, so ^ and $ match at line breaks), and s (dotall, so the dot matches newlines).
- What regex syntax does it use?
- It uses standard JavaScript RegExp syntax, the same engine found in every modern browser and Node.js. That includes character classes, quantifiers, anchors, lookaheads, and both numbered and named capture groups.
- Can I test JavaScript regex here?
- Yes, directly. The tool runs your pattern through the browser's native JavaScript RegExp engine, so whatever matches here will match the same way in your JavaScript or Node.js code.
- Can I test Java regex patterns here?
- Mostly. Java and JavaScript share nearly all common regex syntax, so a typical Java pattern behaves the same way here once you remove the extra backslashes Java needs in string literals. Watch out for a handful of Java-specific constructs like possessive quantifiers, which JavaScript does not support.
- Can I test Python regex here?
- For most patterns, yes. Python's re module and JavaScript share the core syntax, so character classes, quantifiers, and lookaheads work the same. The main thing to adjust is named groups: Python writes them as (?P<name>...) while this tester uses the JavaScript form (?<name>...).
- Can I test C# or .NET regex here?
- Usually. .NET's regex flavor is very close to JavaScript's, and named groups use the same (?<name>...) syntax, so most patterns port cleanly. A few advanced .NET features such as balancing groups have no JavaScript equivalent, so check those separately.
- Can I test Perl regex here?
- For everyday patterns, yes. Much of modern regex syntax originated in Perl and is fully supported by JavaScript. Perl-only extras, like embedded code with the /e modifier or recursive patterns, are not part of the JavaScript engine, so keep those in mind.
- Does it show capture groups?
- Yes. Each match is listed with its full text, its character index in the string, and every numbered ($1, $2) and named group, so you can see exactly what each part of your pattern captured.
- Can I use it as a general regex pattern or expression tester?
- Yes. Any valid regular expression works, from a simple word match to a multi-group pattern with lookaheads and anchors. Paste the pattern and a sample string and it validates the expression and shows every match instantly.
- Why does turning off the global flag only show one match?
- That is how regular expressions actually behave. Without the g flag a regex stops after the first match. Turn on the g flag to find and highlight every match in the test string.