Skip to content

RegEx Tester & Debugger

Test expressions with live capture highlights, build regex patterns using AI, and explore a library of common patterns.

/ /
g
Expression Flags
Highlighted Matches
Matches & Groups (0)
Matches will be listed here.
Saved locally in your browser. Get a key for free from Google AI Studio.

🔑 How to get a free API key:

  1. Visit Google AI Studio and log in with your Google account.
  2. Click the blue "Get API key" button in the sidebar.
  3. Click "Create API key", select a project, and copy the key.
  4. Paste it above. No credit card required.
Generated Output
Describe what you want to extract and click Generate. The resulting RegEx structure and explanations will appear here.

Character Classes

.

Any character except newline

\w

Word character (alphanumeric + _)

\d

Digit character (0-9)

\s

Whitespace character (spaces, tabs, newlines)

[a-z]

Any character in range a to z

[^a-z]

Any character NOT in range a to z

Quantifiers

*

0 or more occurrences

+

1 or more occurrences

?

0 or 1 occurrence (optional)

{n}

Exactly n occurrences

{n,}

n or more occurrences

{n,m}

Between n and m occurrences

Anchors & Boundaries

^

Start of string / line

$

End of string / line

\b

Word boundary

\B

Non-word boundary

Groups & Lookarounds

(x)

Capturing group

(?:x)

Non-capturing group

(?=x)

Positive lookahead

(?!x)

Negative lookahead

What is the RegEx Tester & Debugger?

Regular expressions (regex) are powerful pattern-matching sequences used across every major programming language, text editor, and command-line tool to search, validate, and transform text. Whether you're parsing log files, validating form input, extracting data from HTML, or building search functionality, regex provides a concise syntax for describing complex text patterns. This tester lets you build and debug patterns interactively with real-time match highlighting, capture group inspection, and flag toggling — all running entirely in your browser with zero data uploads.

How to use the RegEx Tester & Debugger?

  1. Enter your regular expression in the pattern input field (without enclosing slashes). The tool validates syntax as you type and flags errors instantly.
  2. Select the flags you need: g (global — find all matches), i (case-insensitive), m (multiline — anchors match line boundaries), s (dotAll — dot matches newlines), or u (unicode).
  3. Paste or type your test string in the text area below the pattern. Matches are highlighted in real-time with alternating colours so overlapping groups are easy to distinguish.
  4. Inspect capture groups in the Matches panel on the right. Group 0 shows the full match; Groups 1, 2, etc. show each capturing parenthesis result.
  5. Browse the 'Common Patterns' tab to load pre-built expressions for emails, URLs, phone numbers, dates, and more. Click 'Use Pattern' to load any pattern into the tester instantly.
  6. Use the 'AI Generator' tab to describe what you want to match in plain English, and let AI produce a regex pattern with explanation and test examples.
  7. Click 'Copy Pattern' to copy your final regex (with flags) to the clipboard. All processing runs entirely in your browser — no data is ever uploaded to a server.

Frequently Asked Questions

Is this regex tester safe for sensitive text?

Yes, runs entirely in browser. Test text and patterns never leave your device.

What is a regular expression?

A sequence of characters defining a search pattern. Used for matching, finding, and replacing text in strings. Supported by all major programming languages.

What regex flags are supported?

g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), y (sticky). Toggle them in the flags panel.

Why isn't my regex matching?

Common issues: forgetting to escape special characters (. * + ? ^ $ [ ] { }), missing anchors (^ $), incorrect flag usage, or greedy vs lazy quantifiers. Use the match highlighter to debug visually.

What is a capture group?

Parentheses ( ) create groups that extract portions of a match. Access groups by index in match results. Named groups use (?<name>pattern) syntax.

Can I test patterns from the pattern library?

Yes, each pattern in the Pattern Library page has a "Test in RegEx Tester" link that pre-loads the pattern into this tester.

RegEx Tester Features

Real-Time Match Highlighting

Matches are highlighted instantly as you type your pattern or test string. Alternating colours distinguish overlapping matches so you can visually scan results without confusion.

Capture Group Inspector

View every capturing group breakdown for each match. Group 0 shows the full match; numbered groups display individual sub-expression results with their position indexes.

JavaScript Regex Flag Support (g/i/m/s/u/y)

Toggle flags on and off with checkboxes. See immediately how global, case-insensitive, multiline, dotAll, unicode, and sticky modes affect your pattern results.

Curated Pattern Library

Browse pre-built patterns for emails, URLs, phone numbers, dates, IP addresses, passwords, and more. Click to load any pattern directly into the tester for immediate testing.

AI Regex Generator

Describe what you want to match in plain English and let AI produce a working regex pattern with an explanation, suggested flags, and test examples.

100% Client-Side & Private

All regex evaluation runs locally in your browser using the native JavaScript RegExp engine. No test data or patterns are ever sent to a server.

Related Developer Tools

Building or debugging patterns? These tools on InstantToolsHub pair well with the RegEx Tester: