Regex Tester
Test regular expressions against sample text with live match highlighting and global, case-insensitive, and multiline flags.
Cheat Sheet
About Regex Tester
The Regex Tester lets you write a regular expression and see exactly what it matches in sample text, instantly. Matches are highlighted in the Match Preview, capture groups are listed under Match Info, and you can toggle the global, case-insensitive and multiline flags with a click.
It includes preset patterns for common tasks such as email addresses, phone numbers, hashtags, ISO dates and passwords, and a cheat sheet of tokens (any character, digit, word character, whitespace, start and end of line) so you can build patterns without leaving the page.
How to use the Regex Tester
- Type your pattern into the Regex Pattern box, or choose a preset to start from.
- Choose flags: Global (g), Insensitive (i) and Multiline (m).
- Paste or type the text you want to test in the Test String area.
- Review the highlighted matches in Match Preview and the groups in Match Info.
- Adjust the pattern until it matches exactly what you intend.
What it can do
Live highlighting
Matches update as you type, so mistakes show up immediately.
Capture groups
Inspect each group of every match to verify extraction patterns.
Flag toggles
Switch global, case-insensitive and multiline behaviour on and off.
Presets and cheat sheet
Start from common patterns and look up tokens without searching the web.
When it is useful
- Building and debugging an input validation pattern for a form.
- Extracting dates, IDs or emails from log files or text.
- Preparing a find-and-replace expression for an editor.
- Learning how regular expressions work by experimenting.
Good to know
- The tester uses JavaScript regular expression syntax. Patterns for other languages (PCRE, Python, .NET) can differ in features such as lookbehind, named groups or possessive quantifiers.
- Email and password presets are practical starting points, not complete validators. Real validation rules vary by system.
- Very complex patterns with nested quantifiers can run slowly (catastrophic backtracking). Test with realistic input sizes.
Related tools: JSON Formatter, Text Case Converter, Word Counter, Password Generator
