Write, test, and debug regular expressions with instant visual feedback. See matches, capture groups, and explanations — all in your browser.
Regular expressions are powerful — and notoriously tricky to get right. A single misplaced character or missing escape can change the meaning entirely. That's why every developer needs a reliable regex tester in their toolkit. Our free online regex testing tool provides real-time matching as you type, highlights all matches and capture groups in your test string, and explains what each part of your pattern does. Whether you're validating email formats, extracting data from logs, or building complex text-processing pipelines, this tool helps you get your regex right the first time.
Regular expressions (often abbreviated as regex or regexp) are sequences of characters that define a search pattern. They're supported by virtually every programming language, text editor, and command-line tool. A regex can match simple literal strings or describe incredibly complex patterns using metacharacters, quantifiers, anchors, and groups.
a
1
@
.
\d
\w
\s
*
+
?
{n,m}
^
$
\b
()
[]
[a-z]
[0-9]
Our online regex tester is designed for speed and clarity:
g
i
m
s
Validating email addresses is one of the most common regex use cases. Here's a practical pattern that covers most real-world email formats:
Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ Flags: (none needed) Matches: ✅ alice@example.com ✅ john.doe+newsletter@company.co.uk ✅ user_123@sub.domain.org ❌ invalid-email ❌ @missing-local.com ❌ no-at-sign.com
Try this in our regex tester with various email strings to see exactly which parts match and why.
Need to pull all URLs out of a block of text? This pattern catches HTTP and HTTPS URLs with optional paths and query parameters:
Pattern: https?://[^\s]+ Flags: g (global — find all matches) Test string: Visit https://example.com or check our docs at https://docs.example.com/api/v2?ref=homepage for details. Matches: 1. https://example.com 2. https://docs.example.com/api/v2?ref=homepage
Server logs follow predictable patterns. Use regex with capture groups to extract structured data:
Pattern: \[(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})\] \[(\w+)\] (.+) Flags: gm (global, multiline) Test string: [2024-03-15 14:32:10] [INFO] Server started on port 8080 [2024-03-15 14:32:11] [WARN] High memory usage detected [2024-03-15 14:32:15] [ERROR] Connection timeout to database Capture groups for each match: Group 1: Date (2024-03-15) Group 2: Time (14:32:10) Group 3: Level (INFO, WARN, ERROR) Group 4: Message
From phone numbers to zip codes, regex is the standard way to validate user input on both client and server side. Test your patterns with edge cases before deploying them to production.
Most code editors support regex in their find-and-replace feature. Our tool helps you build and test replacement patterns with backreferences before using them on your actual files.
Parse CSV files, scrape web pages, or extract structured data from unstructured text. Capture groups let you pull out specific parts of each match.
Web frameworks like Express.js, Django, and Spring use regex-based URL patterns. Test your route patterns to make sure they match the right paths and extract parameters correctly.
Renaming variables, updating import paths, or changing API call patterns across a codebase — regex-powered find-and-replace handles these bulk operations efficiently.
Our tool uses JavaScript's native RegExp engine (ECMAScript), which covers the vast majority of use cases. This means patterns tested here work directly in JavaScript, Node.js, and most web-based environments. For Python or PCRE-specific features, note that some advanced features like lookbehind may behave slightly differently.
g (global) finds all matches instead of stopping at the first. i (case-insensitive) makes the match ignore letter case. m (multiline) makes ^ and $ match line starts/ends instead of the whole string. s (dotall) makes . match newlines too.
Our tool highlights all matches, so if you see no highlighted text, your negative pattern is working. You can also use negative lookahead (?!...) to assert that something should NOT appear at a position.
(?!...)
Yes. Our tool includes a replacement field where you can use backreferences like $1, $2 (or \1, \2) to reference captured groups. The result shows exactly how the replacement would transform your test string.
$1
$2
\1
\2
For the best experience, keep your test strings under 100KB. Larger inputs may cause slight delays in real-time matching. For testing against very large files, consider using a representative sample instead.
Format JSON data extracted by regex patterns for easy reading.
Encode or decode Base64 strings found using regex extraction patterns.
Generate UUIDs and validate them with regex: /^[0-9a-f-]{36}$/i
/^[0-9a-f-]{36}$/i
Decode JWT tokens extracted from Authorization headers using regex.
Read more: JSON Formatter Guide · Base64 Guide · UUID Guide