Regex Tester with Plain-English Explanation
Test patterns, see matches highlighted in real time, and get a plain-English explanation of what each pattern does. 20 common patterns included.
Enter a regex pattern and a test string to see matches highlighted in real time. The plain-English explanation below the input translates each regex token into readable text so you understand what the pattern does, not just whether it matches. Choose from 20 pre-built patterns for common tasks including email, URL, phone numbers, and date formats. Free, no signup.
Common patterns
How to use the regex tester
- 1
Enter your pattern
Type or paste a regex pattern into the Pattern field, or click any entry in the pattern library to load a pre-built pattern for common tasks.
- 2
Set flags
Enable global (g), case-insensitive (i), or multiline (m) flags using the toggle buttons to change how the pattern matches your test string.
- 3
Enter your test string
Paste the text you want to test against. All matches highlight in real time as you type in either the pattern or test string field.
- 4
Read the plain-English explanation
The explanation section translates your pattern into a readable sentence describing exactly what it matches so you can verify it before using it in code.
What this regex tester includes
Live match highlighting
All pattern matches highlight in the test string in real time as you type, with a total count of matches found.
Plain-English explanation
Each regex token is translated into readable text so you understand the full pattern before using it in production code.
Pattern library (20+)
Built-in tested patterns for email, URL, phone, date, IP address, hex color, and more. Click any to load instantly.
Flag toggles
Global, case-insensitive, and multiline flag buttons let you see the effect on matches instantly without editing the pattern.
Error display
Invalid patterns show an error message immediately so you know if your syntax is wrong before spending time testing it.
Browser-only, zero storage
No data is sent to any server. Safe for testing patterns against sensitive text, logs, or internal data.
How to test regular expressions online
Enter your pattern in the Pattern field and your test string in the Test string field. All matches highlight in real time as you type. The plain-English explanation below the input translates each token in your pattern into readable text so you can verify the pattern before using it in production code.
Toggle the global, case-insensitive, or multiline flags to see how they change the matches. For common patterns such as email, URL, or phone number, click any entry in the library to load a tested pattern instantly. If you need to validate or inspect JSON data alongside regex patterns, the JSON formatter can help clean up your test input.
Most useful regex patterns for developers in 2026
The patterns used most often in production code are email validation, URL matching, phone number extraction, date parsing, and IP address validation. All 20 patterns in the library above are tested and ready to use. For email, the pattern matches most standard addresses. For URL matching, the pattern handles http, https, and optional www prefixes.
Date patterns cover ISO 8601 format (YYYY-MM-DD) and common regional formats. The Repeated words pattern is useful for proofreading long documents. The Hex color pattern validates CSS color codes. For beginners, start with the Digits only, Letters only, and Alphanumeric patterns to understand how character classes work before moving on to complex validation patterns. See our regex guide for beginners for a structured walkthrough.
How regex flags change matching behavior
The g flag (global) finds all matches in the string instead of stopping at the first. Without it, most methods return only the first match. The i flag makes matching case-insensitive so hello matches Hello, HELLO, and hElLo. The m flag makes the ^ and $ anchors match the start and end of each line rather than the whole string, which is essential when processing multi-line text.
In JavaScript, flags are written after the closing slash: /pattern/gim. In Python, pass them as re.compile(pattern, re.IGNORECASE | re.MULTILINE). The tester above lets you toggle each flag independently and see the effect on matches in real time.
Frequently asked questions about regex
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used to find, match, extract, or replace text that follows a specific format. Regex is supported in virtually every programming language and is built into most code editors and command-line tools.
How do I write a basic regex pattern?
A basic regex pattern is made up of literal characters that match themselves and special metacharacters with specific meanings. For example, hello matches the exact word "hello". Adding \s+ after it matches one or more spaces. Adding [A-Z] matches any uppercase letter. Start with simple literal patterns and add metacharacters one at a time until the pattern matches what you need.
What do special characters mean in regex?
Special characters in regex have reserved meanings. The most common metacharacters are: . (any character), * (zero or more), + (one or more), ? (zero or one), ^ (start of string), $ (end of string), [] (character class), () (group), | (alternation), and {} (quantifier). To match a literal dot, write \. instead of .
What is the difference between greedy and lazy quantifiers?
Greedy quantifiers like *, +, and {} match as many characters as possible while still allowing the overall pattern to match. Lazy quantifiers add a ? after the quantifier, such as *? or +?, and match as few characters as possible. For example, <.+> matches an entire line of HTML tags greedily, while <.+?> matches individual tags.
What are capture groups in regex?
Capture groups are defined by placing part of a pattern in parentheses (). The text matched by a group can be extracted separately from the overall match. For example, (\d{4}-\d{2}-\d{2}) matches a date like 2026-06-10. In JavaScript, match() and exec() return the full match plus each group. Named groups use the syntax (?<name>pattern).
How do I match an email address with regex?
A commonly used email pattern is ^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$. This matches most standard email addresses. The [\w.-]+ part matches the local part before the @ symbol. The [a-zA-Z]{2,} at the end requires a top-level domain of two or more letters. Click the Email pattern in the library above to load it instantly and test it against your input.
What is the difference between test() and match() in JavaScript?
In JavaScript, test() returns a boolean indicating whether the pattern matches the string. match() returns an array containing the matched text and any capture groups, or null if there is no match. Use test() when you only need to know if the pattern matches. Use match() when you need to extract the matched text or group values.
How do I use regex flags?
The g flag (global) finds all matches instead of stopping at the first. The i flag makes matching case-insensitive. The m flag makes ^ and $ match the start and end of each line. The s flag makes the dot match newlines. In JavaScript, flags are added after the closing slash: /pattern/gi. In Python, pass them as re.compile(pattern, re.IGNORECASE).
What is a lookahead in regex?
A lookahead is a zero-width assertion that checks if a pattern is followed by another pattern without including the second pattern in the match. A positive lookahead (?=pattern) matches only if the following text matches. A negative lookahead (?!pattern) matches only if the following text does not match. For example, \d+(?= dollars) matches a number only when followed by " dollars".
How do I escape special characters in regex?
To match a special character literally, prefix it with a backslash. For example, to match a literal dot, write \. because . without escaping means any character. To match a literal +, write \+. To match a literal (, write \(. The characters that need escaping are: . * + ? ^ $ { } [ ] | ( ) \