Regex Tester
Test regular expressions instantly against sample text. Use JavaScript regex flags, inspect match positions and capture groups, then copy or download the results.
Test Regular Expression
Run a regex pattern against test text
Enter the pattern without surrounding slashes. Supported JavaScript flags depend on your browser.
Test Text
Paste, type, upload or drop text to test
Match Results
Regex matches and capture groups
Waiting
Ready to Test
Enter a regex pattern and test text, then click Test Regex.
Text Size
0 B
Matches
0 B
Groups
0 B
Flags
0%
Browser-Based Regex Testing
This implementation tests JavaScript regular expressions directly in your browser. Pattern matching, capture inspection, copying and statistics do not require your test text to be sent to a server.
Regex Tester Features
Test Regex Patterns in Seconds
Run JavaScript regular expressions against text with browser-based processing.
Instant Matching
Test patterns and inspect matches with one click.
Capture Groups
Inspect numbered and named capture groups for each match.
Regex Flags
Use common JavaScript flags including g, i, m, s, u, y and d.
Copy & Download
Copy match details or save results as a text file.
Three Simple Steps
How to Test a Regular Expression Online
Enter Pattern and Text
Enter a regex pattern, choose flags and paste the text you want to test.
Test Regex
Click Test Regex to validate the input and remove unnecessary formatting.
Copy or Download
Review match indexes and capture groups, then copy or download the results.
Regular Expression Testing Guide
What Is a Regex Tester?
A Regex Tester runs a regular expression pattern against test text and shows which parts match. It helps developers build, inspect and debug patterns before adding them to applications, validation rules, scripts or data-processing workflows.
This tool uses the browser's JavaScript RegExp engine. You can enter a pattern without surrounding slash delimiters, choose flags and inspect match positions, full matches, numbered capture groups and named groups.
Regex Testing Example
Pattern:
\b[A-Z][a-z]+\b
Test text:
Hello from London and Paris.
Matches:
Hello
London
Paris
Why Test Regular Expressions?
Regular expressions can become difficult to understand when they include alternatives, quantifiers, lookarounds and capture groups. Testing against realistic text helps confirm whether a pattern matches too much, too little or the wrong content.
A tester is also useful for checking edge cases such as empty strings, multiline input, Unicode content and repeated matches before deploying a pattern in production code.
How Does Regex Matching Work?
A regex engine interprets a pattern as matching instructions. Literal characters match themselves, while metacharacters and constructs can describe character classes, repetition, boundaries, alternatives and groups.
When global matching is enabled, the tester continues searching after each match. Without the global flag, JavaScript returns the first match only.
Regex Patterns vs Flags
The pattern describes what to match. Flags modify matching behavior. Common JavaScript flags include g for global matching, i for case-insensitive matching, m for multiline anchors and s for dot-all behavior.
Modern browsers may also support Unicode, sticky and match-index flags. Invalid or duplicate flags are reported as regex errors by the JavaScript engine.
Common Uses for Regex Testing
Form Validation
Test patterns for structured identifiers and input formats.
Text Extraction
Find dates, codes, labels and other structured text fragments.
Log Analysis
Match recurring patterns in application and server logs.
Search & Replace
Verify matching logic before running bulk transformations.
Related Tools
More Developer Utilities
JSON Formatter
Beautify JSON with readable indentation and line breaks.
Open Tool →JSON Validator
Check JSON syntax and detect parsing errors.
Open Tool →UUID Generator
Generate unique UUID values for apps and databases.
Open Tool →Developer Tools
Browse more free utilities for developers and coding.
Browse Tools →FAQ
Regex Tester FAQs
Test Regular Expression Now
Enter a regex pattern and test text to inspect matches and capture groups in seconds.
Test Regex →