Regex Tester

Test and debug regular expressions with real-time matching and highlighting. View capture groups, use common patterns library.

/ /g
100% client-side – your data never leaves your device

How to Use Regex Tester

  1. 1 Enter your regex pattern in the pattern field
  2. 2 Type or paste test text in the text area
  3. 3 See matches highlighted in real-time
  4. 4 Toggle flags (g, i, m, s, u) as needed
  5. 5 View capture groups and match details below
  6. 6 Use common patterns for quick start

What You Get

Real-time regex testing with live match highlighting, capture group extraction, and a library of common patterns. Supports all JavaScript regex flags. Perfect for debugging and learning regular expressions.

Input: Pattern: \d+ | Text: "I have 42 apples"

Output: Matches: "42"

Input: Pattern: ([a-z]+)@([a-z]+)\.com

Output: Captures email parts: username, domain

Input: Pattern: ^\w+ (with m flag)

Output: Matches first word of each line

Input: Common: Email pattern

Output: Validates email addresses in text

How do I test a regular expression online?

Enter your regex pattern in the pattern field, paste test text below. Matches highlight in real-time. Toggle flags (g, i, m) as needed for global, case-insensitive, or multiline matching.

What regex flags are available?

g (global): find all matches. i (case insensitive). m (multiline): ^ and $ match line boundaries. s (dotAll): . matches newlines. u (unicode): full Unicode support.

How do I match special characters in regex?

Escape special characters with backslash: \. \* \+ \? \[ \] \( \) \{ \} \| \^ \$ \\. Otherwise they have special regex meanings.

What are capture groups in regex?

Parentheses () create capture groups that extract matched substrings. Access them in replacements with $1, $2, etc. Use (?:...) for non-capturing groups.

How do I match email addresses with regex?

Use the Email pattern from the library: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}. Click the pattern to load it instantly.

How do I match newlines in regex?

Use \n for newline, \r for carriage return. Enable the s flag to make . match newlines. The m flag makes ^ and $ work with line boundaries.

What regex engine does this tool use?

JavaScript RegExp engine (ECMAScript). Most patterns work similarly across languages. Some advanced features like lookbehind have limited browser support.

How do I debug why my regex does not match?

Check flags (need g for multiple matches?), escape special characters, verify your pattern syntax. The tool highlights syntax errors and shows match details including capture groups.

100% client-side processing - your data never leaves your device