~/devtools / regex
tool::regex

Regex
Tester

Test regular expressions with live match highlighting. See match indices, values, and capture groups. Start from common presets.

ad · 728×90
// syntax reference
.any character
*0 or more
+1 or more
?0 or 1
^start of string
$end of string
\ddigit [0-9]
\wword char
\swhitespace
(...)capture group
(?:...)non-capture group
[abc]character class
// presets
/
/g
flags:
ad · 300×250
// about this tool

What is a Regex Tester?

Regular expressions (regex) are powerful tools for finding, validating, and extracting specific patterns from strings. They are used for everything from email and phone number validation to log file analysis.

Regex syntax can seem complex at first, but once learned it works the same way across most programming languages — JavaScript, Python, Java, Go, and many more all share the same basic syntax.

This tool highlights matches in real time as you type your pattern, and shows each match's index and capture groups in detail. Common patterns like email, URL, and date formats are available as one-click presets.

Use Cases
  • Validate email, phone number, and password formats
  • Extract error messages or IP addresses from log files
  • Pattern-based find & replace in code editors
  • Parse specific patterns from scraped or text data
  • Analyze URL structure and extract query parameters
FAQ
Q. What do the g, i, and m flags mean?
g (global) continues searching after the first match. i (case-insensitive) ignores uppercase/lowercase differences. m (multiline) makes ^ and $ match the start/end of each line instead of the whole string.
Q. Why does a dot (.) match any character?
In regex, . is a metacharacter meaning any single character except a newline. To match a literal dot, escape it with a backslash: \.
Q. When should I use capture groups?
Parentheses (...) capture a specific portion of the match for extraction. For example, (\d{4})-(\d{2})-(\d{2}) lets you extract year, month, and day separately from a date string.
// related tools
Cron Expression Generator
Build and parse cron expressions visually. Generate human-readable descriptions and preview next execution times.
jwt
JWT Decoder
Decode and inspect JWT tokens. View header, payload, and signature details.
Color Converter
Convert colors between HEX, RGB, HSL, and more. Pick colors visually.
ts
Timestamp Converter
Convert Unix timestamps to human-readable dates. Supports ms/s, UTC/local, and relative time.