Regex Tester & Validator
Test, validate, and learn regular expressions
Regular Expression
Predefined Patterns
Test String
Results
Test results will appear here
Enter a regex pattern and test string to see matches
About the Regex Tester
Write a regular expression, paste some text and see the matches straight away. You can switch the global, ignore-case and multiline flags, start from ready-made patterns such as email addresses, URLs, IPv4 addresses and dates, and copy the pattern when it works. It uses your browser’s JavaScript regular-expression engine, and nothing is uploaded.
How to use it
- 1
Enter a pattern
Type your regular expression, or choose one of the predefined patterns to start from.
- 2
Set the flags
Tick g (find all matches), i (ignore upper/lower case) and m (^ and $ match at each line) as needed.
- 3
Add test text
Paste the text you want to search in the Test String box.
- 4
Read the results
Matches appear in Results as you type. Adjust the pattern until it finds what you want, then use Copy.
Good to know
- This tests JavaScript (ECMAScript) regular expressions. Other languages such as Python, PHP or PCRE support most of the same syntax but differ in details like lookbehind and named groups.
- The predefined patterns are good starting points, not guarantees — validating real email addresses or credit card numbers properly needs more than a regex.
Frequently asked questions
- What is a regular expression?
- A regular expression (regex) is a compact pattern for finding and checking text — for example, every email address in a document or every line that starts with a number.
- What do the g, i and m flags mean?
- g finds every match instead of just the first, i ignores differences between capital and lowercase letters, and m makes ^ and $ match at the start and end of each line rather than of the whole text.
- Why does my regex find nothing?
- Check that special characters such as . ? + ( ) [ ] are escaped with a backslash when you mean them literally, that the flags are what you expect, and that the test text really contains what the pattern describes.
- Is my test text uploaded anywhere?
- No. The matching runs in your browser, so you can safely test against logs or data you do not want to share.
Tell us how it worked for you.