web

Regex Tester

Test regular expressions online with live match highlighting, capture groups, flags, and replace preview—100% local in your browser.

Pattern OK

2 match(es)

56 characters

Highlighted matches

Match details

#IndexMatchGroups
18[email protected]
227[email protected]

Regular Expressions Course

Learn regular expressions from first principles: literals, metacharacters, flags, capture groups, replacement, and a practical debugging workflow.

Course home

About this tool

DevCove Regex Tester helps developers validate patterns against sample text without leaving the browser. Enter a regular expression and flags, paste logs, URLs, JSON, or form values, and see matches highlighted instantly with index positions and capture groups. Switch to Replace mode to preview substitutions with $1-style backreferences. Common presets cover emails, URLs, IPv4 addresses, digits, and ISO dates.

How to use this tool

Use this regex tester when you need to debug patterns for logs, validation, parsing, or search-and-replace workflows:

  1. Choose Match to highlight results or Replace to preview substitutions.
  2. Enter the pattern without wrapping slashes—the UI shows /pattern/ for readability.
  3. Toggle flags such as g (global), i (ignore case), and m (multiline) to match your target engine behavior.
  4. Paste representative sample text from logs, APIs, HTML, or config files—not just minimal happy-path strings.
  5. Review the match table for index positions and capture groups when building replacements.
  6. In Replace mode, use $1, $2, or $& in the replacement field and enable g when you want every match replaced.
  7. Load sample patterns for emails, URLs, IPv4, digits, or ISO dates when exploring common search intents.

Features

Built for everyday debugging rather than exhaustive engine compatibility testing:

  • Live match highlighting with index positions and capture group columns.
  • Match and Replace modes in one workspace.
  • Toggle g, i, m, s, u, and y flags without memorizing flag strings.
  • Sample patterns for email, URL, IPv4, digits, and ISO date extraction.
  • Replace preview with $1-style backreferences.
  • Copy match rows as TSV or copy replacement output.
  • Clear errors for empty, invalid, or oversized patterns and inputs.
  • Match count limits to reduce catastrophic backtracking risk in the browser.
  • 100% client-side processing—sample text is not uploaded.
  • Complements URL Encoder, JSON Formatter, and JWT Decoder for API and log debugging.

FAQ

Which regex flavor does this tool use?

It uses JavaScript regular expressions—the same engine available in modern browsers and Node.js. Most common patterns transfer from PCRE or Python, but look-around and Unicode property features may differ.

Do I include the /slashes/ in the pattern field?

No. Type only the pattern body. Slashes in the UI are visual delimiters. Enter \d+ rather than /\d+/.

Why are only some matches highlighted?

Without the global (g) flag, JavaScript returns only the first match. Enable g to iterate through all non-overlapping matches in the test string.

Is my test text uploaded?

No. Matching and replacement run entirely in your browser. Avoid pasting secrets unless you accept the usual clipboard and screen-sharing risks.

Why is there a match limit?

Complex patterns on large inputs can cause heavy backtracking in the browser. DevCove caps matches, limits input size, and stops long-running evaluations so the page stays responsive.