Regex Tester — Test Regular Expressions Online
Test and debug regular expressions online. Enter a pattern and test string to instantly see all matches with their index positions.
Test String
Matches
What is a Regex Tester?
A regex tester lets you write a regular expression pattern and instantly test it against a string to see all matches. It shows you the matched text, its position in the string, and how many total matches were found.
Regular expressions are powerful patterns used in almost every programming language for searching, validating, and transforming text. A live tester makes it much easier to build and debug complex patterns.
How to Use the Regex Tester
Enter a Pattern
Type your regular expression into the Pattern field. You do not need to include surrounding slashes.
Set Flags
Enter flags in the Flags field (e.g. gi for global, case-insensitive). Common flags: g global, i case-insensitive, m multiline, s dot-all.
Type Your Test String
Type or paste the text you want to test in the Test String editor. Matches appear instantly in the output panel.
Example
Here is a classic example matching email addresses:
Matching email addresses
Pattern: [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,} Flags: gi
Output:
Frequently Asked Questions
What regex flavour does this tool use?
This tool uses the JavaScript RegExp engine, which is compatible with ECMAScript regular expressions. It supports most common features including lookaheads, lookbehinds, named groups, and Unicode.
What does the "g" flag do?
The g (global) flag makes the engine find all matches in the string instead of stopping after the first one. Without it, only the first match is returned.
Is my data sent to a server?
No. All matching runs entirely in your browser using the built-in JavaScript regex engine. Nothing is transmitted.
Related Tools
See also: JSON Validator, JSON Formatter.