Regex Tester

Our regex tester lets you write and test regular expressions in real-time with instant match highlighting. See all matches, capture groups, and match indices as you type. Supports all JavaScript regex flags (global, case-insensitive, multiline, dotAll, unicode, sticky). Includes a replace mode for search-and-replace testing, plus a comprehensive regex cheat sheet for quick reference.

star 4.9
auto_awesome AI
New
/ /
global | case-insensitive | multiline | dotAll | unicode
info Enter a pattern to start matching
0 matches
find_replace Replace Mode

                        

No matches yet

auto_awesome AI Analysis

Powered by Claude

Regex Analysis:

  • Pattern: Matches email-like patterns
  • Matches found: 2
  • Capture groups: None

Tip: Use the 'g' flag to find all matches in the test string.

lightbulb Tips

  • \d = digit, \w = word, \s = space
  • Use 'g' flag to find all matches
  • Escape special chars: \. \( \[ \+
  • Use (?:...) for non-capturing groups

How to Use This Calculator

edit

Enter Pattern

Type your regex pattern in the pattern field. Syntax errors are highlighted in real-time.

text_fields

Add Test Text

Paste or type the text you want to test against. Matches are highlighted instantly.

tune

Toggle Flags

Enable flags like global (g), case-insensitive (i), or multiline (m) to modify matching behavior.

visibility

View Results

See all matches, capture groups, and match positions. Use replace mode to test search-and-replace.

The Formula

Regular expressions are patterns used to match character combinations in strings. The regex engine scans the test string left-to-right, attempting to match the pattern at each position. Flags modify matching behavior — 'g' finds all matches, 'i' ignores case, 'm' makes ^ and $ match line boundaries.

new RegExp(pattern, flags).exec(testString)

lightbulb Variables Explained

  • pattern The regular expression pattern to match against
  • flags Regex flags: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode)
  • testString The input text to test the pattern against
  • exec() Returns match details including captured groups and indices

tips_and_updates Pro Tips

1

Use the 'g' flag to find all matches, not just the first one

2

Escape special characters with backslash: \. \( \) \[ \] \{ \} \+ \* \?

3

Use (?:...) for non-capturing groups when you don't need the match value

4

\d = digit, \w = word char, \s = whitespace, \b = word boundary

5

Use .+? (lazy) instead of .+ (greedy) to match as little as possible

6

The 'm' flag makes ^ and $ match start/end of each line, not just the string

7

Test edge cases: empty strings, special characters, and very long inputs

Test Regular Expressions Online

Our free regex tester lets you build, test, and debug regular expressions with live match highlighting. See matches, capture groups, and replacement results instantly as you type. Works with JavaScript regex syntax.

Online Regex Tester with Live Preview

Type your regex pattern and see matches highlighted in real-time. Our regex tester supports all JavaScript flags including global, case-insensitive, multiline, and dotAll. Every match is highlighted with capture groups displayed separately for easy debugging.

Regex Pattern Builder & Debugger

Build complex regex patterns with our interactive tool. See exactly what your pattern matches and why. Capture groups are numbered and displayed, making it easy to build patterns for data extraction, validation, and text processing.

Regex Cheat Sheet & Reference

Quick reference for common regex syntax: character classes (\d, \w, \s), quantifiers (+, *, ?, {n}), anchors (^, $, \b), groups and alternation, lookahead and lookbehind. Everything you need to build regex patterns right next to the tester.

Frequently Asked Questions

sell

Tags

verified

Data sourced from trusted institutions

All formulas verified against official standards.