Regex Tester

Write and test regular expressions with live match highlighting, flag toggles, named capture groups, and built-in examples. All runs in your browser.

//g
Flags:

Built-in Examples

How It Works

Enter your regular expression pattern in the top field, then paste or type your test string below. Matches are highlighted instantly as you type — no button needed.

Flags:

  • g GlobalFind all matches, not just the first
  • i Ignore CaseCase-insensitive matching
  • m Multiline^ and $ match start/end of each line
  • s Dot All. matches newline characters too

Tips:

  • Hover over a match in the preview to highlight the corresponding row in the Match Details table
  • Use named groups with (?<name>...) to label captured parts
  • Click any Built-in Example to load a ready-made pattern
  • Use Copy Regex to copy the full /pattern/flags string
highlight

Live Highlighting

Matches are highlighted directly in the test string as you type — colour-coded by match index so overlapping patterns are easy to tell apart.

data_object

Capture Groups

Named and unnamed capture groups are shown in the Match Details panel, including the exact start and end index of every match.

lock

100% Private

All regex processing happens in your browser using the native JavaScript RegExp engine — nothing is sent to any server.

Where to Use This Tool

codeDevelopment

  • • Validate and debug complex regex patterns
  • • Test input validation rules before coding
  • • Extract data from strings with capture groups
  • • Build and verify search/replace patterns

manage_searchData Processing

  • • Parse log files for specific patterns
  • • Extract emails, URLs, or dates from text
  • • Validate data format before importing
  • • Clean and transform raw text data

schoolLearning

  • • Learn regex syntax interactively
  • • Experiment with flags and quantifiers
  • • Understand named capture groups
  • • Study common regex patterns from examples

securitySecurity & Validation

  • • Test input sanitisation patterns
  • • Validate email and phone formats
  • • Build IP address allowlist patterns
  • • Verify password strength rules