Regex Tester
Test and debug regular expressions online free. Write regex patterns, test against sample text, and see matches highlighted instantly.
How to Use Regex Tester
- 1Enter your regular expression pattern in the Regex field (without the surrounding slashes).
- 2Select your flags: g (global), i (case insensitive), m (multiline), s (dotAll).
- 3Paste or type your test string in the Test String area.
- 4All matches are highlighted in the test string in real time.
- 5View the full list of matches, their positions, and captured groups below.
About Regex Tester
The Regex Tester provides a live regex testing environment with syntax highlighting, match visualisation, and group capture display. Supports JavaScript regex syntax (which is compatible with most languages), all flags (g, i, m, s, u), and shows full match, capture groups, and match positions for every hit.
Frequently Asked Questions
- What is a regular expression (regex)?
A regular expression is a sequence of characters that defines a search pattern. Regex is used for string searching, validation, parsing, and text manipulation in virtually every programming language. Patterns match literal characters, character classes, repetition, anchors, and groups.
- What do the regex flags mean?
g (global): find all matches, not just the first. i (case-insensitive): match regardless of letter case. m (multiline): ^ and $ match start/end of each line. s (dotAll): makes . match newlines too. u (unicode): enables full Unicode matching for emoji and non-Latin characters.
- What is the difference between + and * quantifiers?
* matches zero or more occurrences. + matches one or more occurrences. \d* matches zero or more digits (can match an empty string); \d+ requires at least one digit. Adding ? makes them lazy/non-greedy: \d+? matches as few digits as possible.
- How do I match a literal dot or other special characters?
Escape the special character with a backslash: \. matches a literal dot, \* matches a literal asterisk, \( matches a literal parenthesis. Special characters that need escaping: . * + ? ^ $ { } [ ] | ( ) \. In a regex tester, type two backslashes (\\) if your input field interprets single backslashes.
- What are capture groups and how do I use them?
A capture group is a section of the pattern in parentheses: (\d+). It captures the matched text for extraction. Named groups use (?
\d+) syntax. In the matches table, groups appear in the Group column. Groups are essential for extracting specific parts of a match. - How do I test a regex for email validation?
Load the Email example or enter the pattern [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}. Note that email validation via regex is notoriously imperfect — the full RFC 5321 spec is extremely complex. For production use, validate by sending a confirmation email rather than relying solely on regex.
- What is the difference between greedy and lazy matching?
Greedy quantifiers (*, +, ?) match as much text as possible. Lazy quantifiers (*?, +?, ??) match as little as possible. For example, <.+> greedily matches the entire string "bold"; <.+?> lazily matches just "". Use lazy matching when extracting delimited content.
Looking for more tools like this? Browse all Developer Tools →
More Developer Tools
JSON Formatter
Format, validate, and minify JSON online. Instantly beautify or compress JSON data with syntax highlighting. Free JSON formatter and validator.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text online. Free Base64 encoder decoder tool for developers and data analysts.
URL Encoder / Decoder
Encode or decode URLs and query strings online. Convert special characters to percent-encoding instantly. Free URL encoder decoder for developers.
Password Generator
Generate strong, random passwords instantly. Customize length and character types. Free secure password generator tool for safe online accounts.
Color Converter
Convert colors between HEX, RGB, HSL, and HSB online free. Pick colors visually and copy CSS values in any format instantly — no signup needed.
Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and times online free. Convert dates to Unix timestamps in seconds or milliseconds instantly.
You Might Also Like
Word Counter
Count words, characters, sentences, and paragraphs instantly. Free online word counter tool with reading time estimate for writers and students.
Character Counter
Count characters with and without spaces instantly. Free online character counter for Twitter, Instagram, SMS, and meta tag length limits.
Percentage Calculator
Calculate percentages, percentage change, and what percent one number is of another. Free online percentage calculator for everyday math.
Last updated: May 2, 2026 — Regex Tester by CalcDash.