Regex Tester
Free regex tester. Try JavaScript regular expressions against sample text and see every match with its index and capture groups — with clear error messages.
About the Regex Tester
A regex tester that lets you test JavaScript regular expressions against sample text to see matches, indices, and capture groups in real-time.
This tester runs your pattern against any text and reports every match: what matched, at which character index, and what each capture group contains. Regular expressions are the power tool of text processing — and famously easy to get subtly wrong. The difference between a pattern that works and one that corrupts data in production is usually one escape or one greedy quantifier, which is why experienced developers never ship a regex they haven't tested against realistic samples.
It uses JavaScript's regex engine, so what works here works in Node.js and every browser (and mostly everywhere else — the core syntax is shared across languages). All the standard flags are supported: i for case-insensitive, m to make ^ and $ match line boundaries, s to let the dot cross newlines, u for proper Unicode handling. Matches are always listed globally so you see every occurrence, and capture groups — the parenthesised sub-patterns you'll use to extract or reorder text — are printed per match, which is where extraction bugs actually hide.
A sound testing habit: paste text that includes both strings that should match and near-misses that shouldn't. A pattern for 6-digit Indian PINs should match 110001 but reject 11000 and 1100011 — testing only the happy case is how catastrophic replacements happen. Invalid patterns return the engine's actual error message rather than a shrug, and everything runs locally, so testing against production log excerpts is safe.
How to use the Regex Tester
- Enter your regular expression pattern in the Pattern field (without the leading/trailing slashes).
- Optionally add flags like 'g' for global or 'i' for case-insensitive.
- Paste the text you want to test into the Test text field.
- Click 'Test pattern' to view all matches, their positions, and captured groups.
Worked example
Enter the pattern '\b\d{6}\b', flag 'g', and text 'My PIN is 110001'. The tester will highlight '110001' as a match.
Frequently asked questions
- Which regex flavour does this use?
- JavaScript's (ECMAScript). Patterns behave exactly as they will in Node.js and browsers. Core syntax carries over to Python, Java and Go, though advanced features like lookbehind vary by engine.
- What are capture groups?
- Parenthesised parts of a pattern that extract sub-matches — in (\d{2})-(\d{2}), group 1 and group 2 capture the two number pairs separately. The tester prints each group's content for every match.
- Why does my pattern match too much?
- Usually a greedy quantifier: .* grabs as much as possible. Use the lazy form .*? or a more specific character class like [^,]* to stop at the right boundary.
- What does the 'g' flag do?
- The 'g' (global) flag tells the regex engine to find all matches in the text, rather than stopping after the first match. The tester automatically displays all occurrences found.
- Is it safe to paste private logs here?
- Yes, testing happens entirely in your browser using the local JavaScript engine. No patterns or text are ever sent to a server.
More from Avexora
All Avexora products →Business software from the team behind these free tools.
- CRM
Avexora AI CRM
A CRM and project workspace for growing businesses.
Visit Avexora AI CRM - WhatsApp Business API
AvexWA
WhatsApp Business API platform for broadcasts, chatbots and automation.
Visit AvexWA - AI business ecosystem
Avexora AI EBOS
From a blank page to a live funnel in minutes.
Visit Avexora AI EBOS - Enterprise AI
Avexora AI
Enterprise-grade AI systems for operations and growth.
Visit Avexora AI - AI voice calling
Avexora AI Voice Agents
Your business phone, answered by AI in every language, every hour.
Visit Avexora AI Voice Agents - OMR exam software
Avexora ExamOS
AI-powered OMR scanning and exam management for schools.
Visit Avexora ExamOS
Related tools
Free online find and replace tool. Replace text in bulk with case-sensitive, whole-word and regular-expression modes — runs entirely in your browser.
Text Diff CheckerFree text diff checker. Paste two versions of any text and see a line-by-line comparison with additions and removals clearly marked — all in your browser.
Case ConverterFree online case converter. Change text to uppercase, lowercase, title case, sentence case, camelCase, PascalCase, snake_case or kebab-case in one click.
Markdown to HTML ConverterFree markdown to HTML converter. Turn headings, lists, links, bold, code blocks and quotes into clean HTML — with raw HTML safely escaped.
