Developer Tools

Regex Playground

Live Regular Expression Tester & Debugger

Build, test, and debug regular expressions in real-time. Features live match highlighting, capture group visualization, and a comprehensive pattern library for JavaScript, Python, and more.

Regex Pattern

/
/g
Flags:

Test String

Highlighted Matches

0 matches
Contact us at support@example.com or sales@company.org Visit https://example.com/page?id=123 for more info. Call (555) 123-4567 or 555.987.6543 Server IP: 192.168.1.100 Colors: #FF5733, #3498db, #2ecc71 Date: 2026-02-04 ID: 550e8400-e29b-41d4-a716-446655440000

Match Details

Enter a pattern to see matches

Quick Reference

.
Any character
\d
Digit [0-9]
\w
Word char
\s
Whitespace
^
Start of line
$
End of line
*
0 or more
+
1 or more
?
0 or 1
{n,m}
n to m times
[abc]
Character class
(abc)
Capture group

atjust99 Join Amazon and Flipkart Deals and products under 99 Telegram Channel: @atjust99

What this tool does

This regex playground lets you write a regular expression and immediately see which parts of your test string it matches. Matches light up as you type, capture groups are broken out into a readable list, and you can toggle flags like global or case-insensitive without editing the pattern by hand.

The tool runs entirely in your browser using the JavaScript RegExp engine (ECMA-262). Nothing is sent to a server.

Why another regex tool?

Most online regex testers do the same thing: paste a pattern, see highlights. This one adds a few things I kept wishing other tools had.

First, the capture group panel shows numbered groups, named groups ((?<name>...)), and exact start/end indices side by side. When you're debugging a pattern with five nested groups, not having to mentally map $3 to a substring saves real time.

Second, there's a preset library with common patterns you can load in one click, then tweak. Email validation, UUID matching, IPv4 addresses, ISO dates, US phone numbers. Saves a trip to Stack Overflow.

Third, the flag toggles sit next to the pattern input so you can flip g, i, m, s, or u on and off without retyping anything.

How to use it

  1. Type your regular expression in the pattern field.
  2. Paste or type the text you want to test against.
  3. Matches appear highlighted in the output panel as you type.
  4. Click any match in the detail list to see its index, length, and capture groups.
  5. Use the "Patterns" button to load a preset, then modify it to fit your use case.

Quick reference

PatternWhat it matchesExample
.Any character except newlinea.b matches acb
\dA digit (0-9)\d{3} matches 123
\wA word character (letter, digit, underscore)\w+ matches word_1
\sA whitespace character\s matches a space or tab
^ / $Start / end of string (or line, with m flag)^Hello
* / +Zero or more / one or morea* matches empty string or aaa
?Zero or one (optional)colou?r matches color and colour
[abc]Any character in the set[aeiou] matches vowels
(abc)Capture group(id):\d+ captures id

A few things worth knowing about JavaScript regex

The RegExp engine in browsers follows the ECMA-262 specification. That means:

  • Lookbehinds work in all modern browsers (Chrome 62+, Firefox 78+, Safari 16.4+). Older browsers will throw a syntax error.
  • Named capture groups use the (?<name>...) syntax added in ES2018.
  • The u flag is needed for correct Unicode handling. Without it, patterns like \p{L} (any Unicode letter) don't work.
  • The d flag (hasIndices) returns start and end indices for each capture group. It's supported in Chrome 90+ and Firefox 88+.
  • ReDoS risk: Patterns with nested quantifiers like (a+)+ can cause catastrophic backtracking. If the playground seems frozen, the pattern is probably ReDoS-vulnerable. Reload the page and simplify your quantifiers.

Who uses this

Developers testing form validation or log parsing rules. Sysadmins writing grep or sed patterns. Students learning regex syntax for the first time. Basically anyone who'd rather see matches highlighted live than stare at a RegExp constructor and guess.

Privacy

All pattern matching runs in your browser's JavaScript engine. No test strings, patterns, or results leave your machine. There is no server-side component for this tool.

Frequently asked questions

Which regex engine does this use? JavaScript's built-in RegExp, which follows the ECMA-262 spec. The same engine that runs in Node.js, Chrome, Firefox, and Safari.

Can I test lookaheads and lookbehinds? Yes. Positive and negative lookaheads ((?=...), (?!...)) have been supported for years. Lookbehinds ((?<=...), (?<!...)) require a relatively modern browser (see the compatibility note above).

Why did the page freeze when I typed my pattern? The most common cause is catastrophic backtracking (ReDoS). A pattern like (a+)+b on a string of aaa... without a b forces the engine into exponential work. Close or reload the tab, then restructure the pattern to avoid nested quantifiers.

How do I use named capture groups? Write (?<year>\d{4})-(?<month>\d{2}) and the match detail panel will show groups labeled year and month alongside the numbered groups.

Does Unicode work? Only when the u flag is enabled. Without it, character class escapes like \p{Script=Greek} throw an error.

Can I copy the finished regex directly into code? Yes. The copy button outputs the pattern and flags in a format you can paste into a new RegExp(...) constructor or a regex literal like /pattern/gi.

Is there a match limit? The tool caps at 10,000 matches to prevent the browser from locking up on very broad patterns against large inputs. If you hit the cap, you'll still see the first 10,000.

What if my pattern works here but fails in Python or Go? Different engines have different feature sets. Python's re module doesn't support lookbehinds with variable-length patterns, for example. This tool tests JavaScript only. For cross-engine compatibility testing, try regex101.com which supports multiple flavors.

Related tools

Related Tools

HTTP Header Analyzer - Professional Website Security Audit

Developer Tools

Scan your website headers for security vulnerabilities, caching efficiency, and information leakage. Get a professional grade (A+ to F) and actionable advice to harden your server.

Try Now

AI Acronym Finder: Instantly Decode Any Abbreviation

Developer Tools

Struggling with industry jargon? Our AI-powered Acronym Finder provides instant, context-aware definitions for any acronym or initialism. Get clear explanations and usage examples in seconds.

Try Now

Code Screenshot Generator - Beautiful Code Snippet Images

Developer Tools

Transform your source code into stunning, professional screenshots. Choose from multiple editor themes, vibrant gradients, and macOS-style frames. Perfect for Twitter, LinkedIn, and blogs.

Try Now

Color Palette Generator - Extract Colors From Image & Hex

Developer Tools

Create professional color schemes in seconds. Extract palettes from images or generate them from hex codes with instant export to CSS, Tailwind, and Figma.

Try Now

Cron Expression Builder - Visual Cron Schedule Generator

Developer Tools

Create and test cron expressions visually. Generate human-readable schedules, preview upcoming run times, and use presets for Linux crontab and automation workflows.

Try Now

HTML to Markdown Converter

Developer Tools

Effortlessly convert your HTML code into clean, readable Markdown with our free online tool. Perfect for developers, writers, and content managers.

Try Now

Markdown Table Generator - Professional Online Table Editor

Developer Tools

Create clean, aligned Markdown tables visually. Features spreadsheet-like editing, CSV/JSON imports, and instant export to Markdown, HTML, and CSV for GitHub and documentation.

Try Now

Test MCP Server Online - Free Model Context Protocol Debugger

Developer Tools

Explore, test, and debug Model Context Protocol (MCP) servers with our advanced GUI. Discover available tools, execute methods with custom JSON arguments, and monitor real-time logs.

Try Now

Random CSV Generator - Generate Structured CSV Data

Developer Tools

Generate random CSV data with custom columns, data types, and export options. Create test data, sample datasets, and structured information for analysis and development.

Try Now

Random TSV Generator - Generate Tab-Separated Values

Developer Tools

Generate random TSV data with custom columns and data types. Create structured tab-separated files perfect for data analysis, spreadsheet applications, and simple data exchange.

Try Now

Schema Converter - JSON to TypeScript & Zod Online

Developer Tools

Transform JSON instantly into TypeScript interfaces, Zod schemas, JSON Schema, or GraphQL types. Features recursive type inference and professional customization options.

Try Now

SVG Editor & Optimizer - Professional Online Vector Tool

Developer Tools

Edit, clean, and optimize SVG files in real-time. Reduce file size, remove metadata, and preview vector changes instantly for faster web performance.

Try Now