👨‍💻 More dev tools: JSON Formatter, UUID Generator, JWT Decoder, Base64 Encoder — all free on KJSynthora.
JSON Formatter →
/
/
Flags
g global
i case
m multi
s dot
u unicode
Matches: 0  ·  Groups: 0
Test String
1
Matches
Groups
Detail
Enter a pattern above to see matches
Reference
Replace
Library
Character Classes
\dAny digit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word character
\sWhitespace
\SNon-whitespace
.Any char except newline
[abc]Character set
[^abc]Negated set
[a-z]Range a to z
Anchors
^Start of string/line
$End of string/line
\bWord boundary
\BNon-word boundary
Quantifiers
*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (optional)
{n}Exactly n times
{n,m}Between n and m times
*?0 or more (lazy)
+?1 or more (lazy)
Groups & Lookarounds
(abc)Capturing group
(?:abc)Non-capturing group
(?<name>)Named group
a|bAlternation
(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind
Escapes
\nNewline
\tTab
\.Literal dot
Replacement Pattern
Quick References
$&
$1
$2
$3
$`
$'
Result Preview
Enter a replacement pattern above
📧 Email Address
/[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}/g
Standard email validation
🌐 URL / Link
/https?:\/\/[^\s]*/gi
HTTP and HTTPS URLs
📱 Indian Phone Number
/(?:\+?91[-\s]?)?[6-9]\d{9}/g
10-digit Indian mobile numbers
📞 US Phone Number
/(\+1)?(\(?\d{3}\)?[-\s]?)\d{3}[-\s]?\d{4}/g
US/Canada formats
🖥 IPv4 Address
/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g
IPv4 address detection
🆔 UUID / GUID
/[0-9a-fA-F]{8}-…-[0-9a-fA-F]{12}/gi
UUID v1–v5 format
🎨 Hex Color Code
/#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\b/g
CSS #rrggbb or #rgb
💳 Credit Card
/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g
16-digit card numbers
🔒 Strong Password
/(?=.*[a-z])(?=.*[A-Z])(?=.*\d)…/g
Min 8 chars + upper+digit+symbol
🏷 HTML Tags
/<([a-z]+)…>/gi
HTML opening/self-closing tags
💬 Code Comments
/\/\/[^\n]*|\/\*[\s\S]*?\*\//g
JS single/multi-line comments
📆 Date DD/MM/YYYY
/complex date validation/g
Valid calendar dates + leap year
📦 JS Variables
/(?:const|let|var)\s+(\w+)\s*=\s*(.+)/gm
JS variable declarations
✉️ Email (Simple)
/[\w-]+@[\w-]+(?:\.[\w-]+)+/g
Simple email extraction

Why Use KJSynthora Regex Tester?

Real-time Matching

Matches highlight instantly as you type — no button click needed. Zero latency feedback.

🎯

Group Capture

View all capturing groups, named groups, and their positions in a dedicated Groups tab.

🔄

Substitution/Replace

Preview regex replacements with $1, $& and named group references in real-time.

📚

Pattern Library

14+ ready-to-use patterns: email, URL, phone, IPv4, UUID, hex color, credit card, and more.

🔗

Shareable URLs

Share your pattern and test string via URL. Perfect for team collaboration and debugging.

📥

Export Matches

Export all matches with positions and groups to a text file for documentation or reporting.

Frequently Asked Questions

What is a regex tester and how do I use it?
A regex tester lets you write and test regular expression patterns against sample text in real-time. Enter your pattern in the top field (between the / delimiters), paste your test string in the text area, and matches are highlighted immediately in yellow. Use the flag buttons to toggle global (g), case-insensitive (i), multiline (m) and other flags.
What regex flavors are supported?
This tool uses JavaScript's ECMAScript RegExp engine. It supports all modern regex features including lookaheads, lookbehinds, named capturing groups (?<name>), dotAll mode (s flag), and unicode mode (u flag). Most patterns are also compatible with Python, Java, Ruby, and PHP with minor modifications.
How do capturing groups work?
Wrap part of your pattern in parentheses to create a capturing group: (pattern). Click the Groups tab to see all captured group values. Use named groups with (?<name>pattern) syntax. In substitution, reference groups with $1, $2, or ${name} for named groups.
How do I use regex for search and replace?
Click the "Replace" tab in the right panel. Enter your replacement pattern in the input. Use $& for the full match, $1 $2 for capture groups, $` for text before the match, and $' for text after. The result preview updates in real-time as you type.
Can I share my regex with someone else?
Yes! Click the "Share" button in the header. This copies a URL to your clipboard that encodes your regex pattern, flags, and test string (up to 500 characters). Anyone opening the link will see the same regex setup.

Related Developer Tools

❤️ Support KJSynthora

All 90+ developer and productivity tools are completely free. If they help your work, consider a small support!

☕ Support KJSynthora