Test regular expressions online with match highlighting. Validate regex patterns against test strings
Real-time regular expression testing.
Supports flags: g (global — all matches), i (case-insensitive), m (multiline mode).
Shows all matches found with their positions in the text.
Online Regex Tester — Test Regular Expressions with Highlighting
Regular expressions (regex) are a powerful tool for searching, validating, and replacing text by pattern. Our tester highlights matches directly in text, shows capture groups, includes a pattern library, and provides a syntax cheat sheet.
Basic Regex Syntax
| Metacharacter | Meaning | Example |
|---|---|---|
. | Any character (except \n) | a.c → abc, a1c |
\d | Digit [0-9] | \d{3} → 123 |
\w | Word character | \w+ → hello |
^ / $ | Start / end of string | ^hello$ |
* / + / ? | 0+, 1+, 0 or 1 | colou?r |
(group) | Capture group | (\d+)-(\d+) |
Regex Flags
| Flag | Name | Description |
|---|---|---|
g | Global | Find all matches, not just the first |
i | Case-insensitive | Ignore letter case |
m | Multiline | ^ and $ match per line |
s | Dotall | Dot matches \n too |
Common Patterns
- Email:
^[\w.-]+@[\w.-]+\.[a-z]{2,}$ - URL:
https?://[^\s]+ - IP address:
\b(?:\d{1,3}\.){3}\d{1,3}\b
Capture Groups
Parentheses create capture groups, allowing you to extract parts of a match separately. Our tester displays all groups for each match.
Frequently Asked Questions
What is the difference between greedy and lazy quantifiers?
Greedy (*, +) capture the longest match. Lazy (*?, +?) capture the shortest.
How to escape special characters?
Use a backslash: \., \*, \(.
Does regex work the same across languages?
Basic syntax is the same, but advanced features (lookbehind, named groups) differ between JavaScript, Python, PCRE, and POSIX.
How to test regex without writing code?
Paste the pattern and test text into our tester — matches highlight in real time and capture groups appear below each match.
For text comparison use Text Diff, for password testing — strength analyzer.
Useful articles
WCAG Color Contrast: Website Accessibility Guide
A complete guide to color contrast: WCAG 2.1 standards, AA and AAA levels, calculation formula, practical examples of good and bad contrast, and how to fix accessibility issues.
CSS Border Radius: Rounding Element Corners
How to use border-radius: syntax, shorthand notation, elliptical corners. Online border-radius generator.