← back to tools

>_ REGEX TESTER

⚡ runs locally
/ /
Quick Patterns
matches will appear here...
idle
0 matches
0 ms

Regex Tester — Test Regular Expressions Online

Regular expressions (regex) are sequences of characters that define search patterns. Developers, data engineers, and system administrators use regex to validate input, search and replace text, parse log files, extract data from strings, and enforce formatting rules. Despite their power, regular expressions can be difficult to write and debug without a live testing tool.

How to Use This Tool

Enter your regex pattern in the pattern field at the top of the page. Toggle flags such as g (global), i (case-insensitive), m (multiline), and s (dotall) to adjust matching behavior. Paste or type your test string in the text area below. Matches highlight instantly as you type — no button click required. The match details table shows each match index, value, and any captured groups with color-coded labels. Use the quick-pattern buttons to load common patterns with sample test strings so you can experiment right away.

Common Regex Patterns

PatternRegexExample Match
Email[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}user@example.com
URLhttps?://[\w.-]+(?:\.[a-zA-Z]{2,})(?:/[^\s]*)?https://example.com/path
IP Address\b(?:\d{1,3}\.){3}\d{1,3}\b192.168.1.1
Phone Number\+?1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}(555) 123-4567
Date (YYYY-MM-DD)\d{4}[/-]\d{1,2}[/-]\d{1,2}2026-03-22
Hex Color#[0-9A-Fa-f]{3,8}#5DCAA5
ZIP Code (US)\b\d{5}(-\d{4})?\b90210

Regex Syntax Quick Reference

Character classes: \d matches any digit (0-9). \w matches any word character (letters, digits, underscore). \s matches any whitespace (space, tab, newline). Use uppercase versions (\D, \W, \S) to match the opposite. Square brackets define custom sets: [aeiou] matches any vowel, and [^0-9] matches any non-digit.

Quantifiers: * matches zero or more times. + matches one or more times. ? matches zero or one time. {n} matches exactly n times, {n,} matches n or more, and {n,m} matches between n and m times. Append ? to any quantifier to make it non-greedy.

Anchors: ^ matches the start of a line and $ matches the end. \b matches a word boundary, which is useful for matching whole words without partial matches.

Groups and alternation: Parentheses () create capture groups for extracting parts of a match. Use | for alternation — for example, (cat|dog) matches either “cat” or “dog”. Non-capturing groups (?:...) group without capturing, which is useful when you need grouping but do not need the matched value.

Privacy and Performance

This regex tester runs 100% in your browser using the JavaScript RegExp engine. No data is transmitted to any server. Your patterns and test strings never leave your machine, making it safe for testing against sensitive data such as log files, credentials patterns, or proprietary formats. The tool evaluates matches in real time and displays execution time in milliseconds so you can gauge pattern performance.