Regex Tester

Test and debug regular expressions in real-time. See matches highlighted, view capture groups, and experiment with common regex patterns.

//g

Match Results

0 matches

Enter a pattern to start testing

Quick Reference

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

Regex Tester & Debugger

Test regular expressions in real-time. Instant match highlighting, capture group inspection, and JavaScript-compatible patterns.

Common Regex Patterns

How this Regex Tester works

This regular expression debugging environment provides real-time pattern matching against test strings using JavaScript's native RegExp engine. Pattern input accepts standard regex syntax rendered in a styled terminal-like interface showing the complete /pattern/flags format.

Flag toggles control matching behavior: global (g) finds all matches versus first only, case insensitive (i) ignores letter casing, multiline (m) treats ^ and $ as line boundaries, dotAll (s) makes . match newlines, and unicode (u) enables full Unicode pattern support. The engine validates patterns immediately, displaying descriptive error messages for syntax violations.

Match highlighting applies yellow background to matched substrings in the preview panel while the results section displays each match with position index and captured groups from parenthetical expressions. The quick pattern library provides one-click loading for common patterns: email, URL, phone number, IP address, date, hex color, HTML tags, and credit card numbers—each with representative test strings demonstrating matches and non-matches. Reference table displays essential regex metacharacters and quantifiers.

How to use this Regex Tester

1

Enter Pattern

Type your regular expression pattern in the pattern field.

2

Add Test String

Enter the text you want to test against your regex.

3

View Results

See matches highlighted with details about captured groups.

Example Usage

Testing a simple number pattern:

Input
Pattern: \d+ | Test: "I have 42 apples and 7 oranges"
Output
Matches: ["42", "7"] with positions highlighted

Frequently Asked Questions

What regex flags are available?
Global (g) finds all matches, Case Insensitive (i) ignores case, Multiline (m) treats ^ and $ as line boundaries, DotAll (s) makes . match newlines, and Unicode (u) enables full Unicode support.
How do I use capture groups?
Wrap parts of your pattern in parentheses () to create capture groups. They appear in the "Groups" section of each match.
Why is my regex not matching?
Check that flags are set correctly (especially case sensitivity), escape special characters like . and *, and ensure your pattern matches the exact text format.
Can I test JavaScript regex here?
Yes! This tool uses JavaScript's native RegExp engine, so patterns work exactly as they would in your JS code.

Related Tools

The Regex Tester is maintained by CodeItBro. We aim to provide the best free developer tools on the web. If you have feedback or suggestions, please visit our contact page.

Featured on

CodeItBro - Free dev tools + practical guides to help you ship faster | Product HuntCodeItBro - Free Online Developer Tools badgeCodeItBro badge