Regex Tester

Test regular expressions with real-time matching, groups, and detailed analysis.

Regex Pattern & Test Text

Enter your regex pattern and test text

//
Common flags: g (global), i (case-insensitive), m (multiline), s (dotall)
Characters: 0

Test Results

Matches, groups, and analysis

Regex Quick Reference

Basic Patterns

  • . - Any character
  • * - 0 or more
  • + - 1 or more
  • ? - 0 or 1
  • ^ - Start of line
  • $ - End of line

Character Classes

  • \d - Digit [0-9]
  • \w - Word char [a-zA-Z0-9_]
  • \s - Whitespace
  • [abc] - Any of a, b, c
  • [a-z] - Any lowercase
  • [^abc] - Not a, b, or c

Quantifiers

  • {3} - Exactly 3
  • {3,} - 3 or more
  • {3,5} - Between 3 and 5
  • (abc) - Capture group
  • (?:abc) - Non-capture group
  • abc|def - abc OR def

Regular expressions are powerful, terse, and easy to get wrong. The ToolEdge Regex Tester lets you write a pattern and a test string side by side, see matches highlighted in real time, and inspect capture groups — so you know whether your expression actually does what you think it does before you ship it.

Every match is shown with its start and end index plus the captured groups, which is what most language libraries (Python's `re`, JavaScript's `RegExp`, Go's `regexp`) actually return. Toggling flags like `g` (global), `i` (case-insensitive), and `m` (multiline) reveals how each one changes the result, which is the fastest way to learn flag semantics by example.

Common use cases

  • Building a regex to validate user input (emails, phone numbers, custom IDs) before adding it to your app.
  • Debugging a regex that works in development but fails on real data — paste the real data and watch what matches.
  • Learning regex by experimenting — change one character of a pattern and see how the match set shifts.
  • Extracting data from log files or unstructured text by iterating on a pattern until matches look right.
  • Crafting find-and-replace patterns for use in editors (VS Code, Vim, Sublime) or shell tools (`sed`, `ripgrep`).

Frequently asked questions

JavaScript / ECMAScript regex (the same flavor as RegExp in browsers and Node.js). It is close to PCRE but not identical — lookbehinds, possessive quantifiers, and some Unicode property escapes behave slightly differently. If you are targeting Python's re or Java's Pattern, test in those engines before shipping.