An online regex tester shows you exactly which parts of a string your regular expression matches - with live highlighting and captured group details - making pattern building intuitive instead of frustrating.
What is a Regular Expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. Regex is used in virtually every programming language and text editor for:
- Validating input (email, phone numbers, passwords)
- Searching and extracting data from text (log parsing, data scraping)
- Find-and-replace operations in editors and code
- Routing patterns in web frameworks
- File name matching in shells and CI/CD pipelines
How to Use the Regex Tester
- Open the Regex Tester on UtilWave.
- Enter your regular expression in the Pattern field (without slashes).
- Select your flags:
g(global),i(case-insensitive),m(multiline), ors(dot-all). - Type or paste your test string in the Test String area.
- Matches are highlighted instantly. The panel below shows each match, its position, and any captured groups.
- The match count updates in real time as you type.
Common Regex Patterns
Email validation
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
US phone number
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}
ISO date (YYYY-MM-DD)
\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])
Extract URLs from text
https?://[^\s]+
Match hex color codes
#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b
Understanding Regex Flags
| Flag | Meaning |
|---|---|
| g | Find all matches, not just the first |
| i | Case-insensitive matching |
| m | ^ and $ match line boundaries, not just string boundaries |
| s | Dot (.) matches newline characters as well |
FAQ
Which regex flavor does this tool use?
The tester uses JavaScript's built-in RegExp engine, which is ECMAScript-standard. It supports lookaheads, lookbehinds (ES2018+), named capture groups, and Unicode properties.
How do I reference a captured group?
In the match results panel, each group is numbered starting from 1. Named groups ((?<name>...)) appear with their name.
What does the ^ anchor do?
^ matches the start of the string (or line with the m flag). It does not mean "not" when used at the start of the pattern - it only means "not" when used inside a character class [^...].
Can I test multiline strings?
Yes - paste a multiline string into the test area and use the m flag to match line boundaries.
Build and debug patterns instantly with the free Regex Tester.