Skip to tool
FeuTex · free tools runs in-browser no bloat built by LiMiT

Regex Checker (JS)

Paste text, enter a JavaScript regex pattern + flags, then test, list matches (with capture groups), or preview a replacement. Everything runs locally—no network calls.

Category: Developer · URL: /tools/regex-checker-js.html
Tip: In JS strings you often need double escaping. Here you type the raw pattern (use \d, \b, etc.).
Common: g i m s u y. Duplicates/invalid letters will error.
Supports $1, $2… and $& like JavaScript String.replace.
Output is limited to keep the page fast (max matches and max output size).


  
Privacy: runs locally in your browser. No uploads, no tracking scripts.

How to use

Use this to quickly verify a JavaScript RegExp and inspect matches.

  1. Enter a pattern (without surrounding /) and optional flags (e.g., gim).
  2. Paste your text in the input box.
  3. Click Find All to list matches + groups, Test (First) for the first match, or Replace Preview to see the replaced output.
Keywords this page targets (natural cluster): regex checker js, javascript regex tester, regex test online javascript, regex validator js, check regex pattern javascript, regex match groups javascript, find all regex matches js, regex replace tester js, regex flags g i m s u y, escape backslashes in regex js, regex exec loop javascript, regex match indices javascript, validate regular expression in js, regex multiline mode javascript, regex dotall flag javascript, regex unicode flag javascript, regex global match javascript, debug regex javascript, regex capture group tester, regex error invalid regular expression
Secondary intents covered: Validate whether a regex pattern is syntactically correct in JavaScript, Test a regex against input text and see if it matches, List all matches with indexes and capture groups, Preview a regex replacement result before using it in code, Debug why a regex does not match (flags, escaping, multiline), Copy results to clipboard for sharing or bug reports, Check performance by limiting huge match outputs

FAQ

Do I include the /slashes/ around the regex?

No—enter only the pattern text (for example \d+), and type flags separately (for example gi).

Why does \d not work unless I type two backslashes?

In this tool you type the raw regex pattern, so a single backslash is correct (type \d). If you put a regex inside a JS string literal in code, you often need double escaping.

What does Find All do if I forget the g flag?

It automatically adds g for iteration, so you still get a full match list.

Can I see capture groups?

Yes—each match line shows a groups array containing $1, $2, etc.

Why am I getting “Invalid regular expression”?

The pattern or flags are not valid for JavaScript (common causes: unbalanced parentheses, bad character class, duplicate/invalid flags).

Does this send my text to a server?

No. All regex operations run locally in your browser and the tool makes no network requests.

How do I avoid infinite loops with patterns like .*? or ^?

The tool guards against zero-length matches by advancing the index by 1 when a match is empty.