Web Analytics

 Regex Tester Online

Test JavaScript regular expressions against sample text. Highlight matches, inspect capture groups, choose flags, and preview replacements directly in your browser.

Regular expression
/ /
Uses the JavaScript regular expression syntax.
Flags
Supports JavaScript replacement tokens such as $&, $1, and $$.
Matches in text
#IndexMatchCapture groups
Replacement result

⭐ Regex Tester Online - Test JavaScript Regular Expressions

This online regex tester checks JavaScript regular expressions against your text. Review highlighted matches, match positions, capture groups, and a replacement preview without installing software.


⭐ What Can This Regex Tester Do?

  • Tests regular expressions using JavaScript RegExp syntax.
  • Highlights matches and reports their character index.
  • Shows numbered and named capture groups for each match.
  • Supports global, ignore-case, multiline, dot-all, and Unicode flags.
  • Previews replacements with JavaScript tokens such as $1 and $&.
  • Copies or downloads the replacement result as plain text.

⚙️ How to Test a Regular Expression

  1. Enter a pattern without slash delimiters, such as \b(\w+)@(\w+\.\w+)\b.
  2. Choose flags such as g for all matches or i to ignore letter case.
  3. Paste the text to test and select Test regex.
  4. Inspect highlighted matches and capture groups. Enter replacement text to preview the result.
  5. Copy or download the replacement text when it is ready.

🔎 Example: Find Email-Like Text

Pattern: \b([\w.-]+)@([\w.-]+\.[A-Za-z]{2,})\b with the g flag.

Test text: Contact ada@example.com for details.

The tester highlights the address and shows ada and example.com as capture groups. A replacement such as $1 [at] $2 previews ada [at] example.com.


⚠️ JavaScript Regular Expression Notes

  • Enter the pattern without surrounding slash delimiters; select flags separately.
  • Syntax and replacement behavior follow the browser JavaScript engine, which may differ from PCRE, Python, or .NET regex.
  • Without the global flag, only the first match is listed and only the first occurrence is replaced.
  • Regex matching can be expensive for pathological patterns and very large text.

⭐ Private, Browser-Based Regex Testing

Your pattern and test text are processed locally in your browser. This regex tester does not upload or store your input.


This tool is also known as

  • regex tester online
  • test regular expressions in javascript
  • regular expression tester with matches
  • regex match and replace tool
  • online regex capture group tester

Frequently Asked Questions

Enter a JavaScript regex pattern without slash delimiters, choose flags, paste test text, and select Test regex. Matches, capture groups, and a replacement preview appear below.

The tester uses the JavaScript RegExp syntax supported by your browser. It may differ from PCRE, Python, Java, or .NET regular expressions.

The g flag finds all matches in the test text. Without it, the tester lists only the first match and JavaScript replaces only the first occurrence.

The i flag makes matching case-insensitive, so uppercase and lowercase versions of a letter are treated as equivalent.

The m flag makes the start and end anchors match the beginning and end of each line, not only the beginning and end of the whole input.

The s flag lets a dot match line break characters as well as other characters.

Yes. Each match row lists numbered capture groups and, when present, named capture groups.

Use JavaScript replacement tokens such as $1 for the first capture group, $& for the whole match, and $$ for a literal dollar sign.

The browser checks the pattern using JavaScript RegExp syntax. Check escaping, brackets, quantifiers, and character classes, then try the pattern again.

Without the g flag, only the first match is tested. Some zero-width matches have no characters to highlight, but their position and match are still listed.

No. The pattern and test text are evaluated locally in your browser and are not uploaded or stored by this tool.

Not necessarily. This tool uses JavaScript regular expressions, so PCRE-specific features may need to be rewritten for JavaScript.

Our web tools

General
Generate
HTML entities
Text to HTML
Clean code
URL
  • URL cleaner
    Clean, normalize, and sanitize URLs in bulk — remove UTM, fbclid, gclid and other tracking parameters
  • URL parser
    Parse URL structure, query values, tracking parameters, and generate a clean URL
Web colors
Compress
Encoding & decoding
Extract