Developer Tools

Regex Tester

Test patterns, explore groups, and try replacements.

Regex Tester

Powered by UtilBrix

JavaScript regular expressions. Processing runs in a worker and stops after 3 seconds. Quick reference: \d digit, \w word, \s whitespace, + one or more, * zero or more, ^ start, $ end.

Your inputs stay in your browser. No account required.

How to use this tool

  1. Enter a JavaScript regular-expression pattern and the desired flags.
  2. Paste representative test text, including examples that should not match.
  3. Optionally enter a replacement string, then inspect matches, groups, indexes, and replacement output.

Formula & method

The browser executes JavaScript RegExp semantics in a dedicated worker. Match details include text, zero-based UTF-16 indexes, captured groups, and named groups. The replacement string follows JavaScript replacement conventions, including $1 and named references.

A practical example

The pattern \d+ with flag g finds 12 and 34 in order 12, item 34. A worker timeout stops patterns that take too long.

When this tool is useful

Develop a pattern for text extraction or cleanup before adding it to an application. Testing both matching and nonmatching examples helps catch a pattern that works on one sample but accepts too much.

Common mistakes and limitations

  • Regular-expression syntax and flags differ between languages; this tool uses JavaScript semantics.
  • A pattern can be expensive on long input. The worker time limit protects the page, but a timeout means the pattern needs review.

Frequently asked questions

Why am I seeing only one match?

Check the global g flag if you intend to find repeated matches. Other flags such as i and m affect case sensitivity and line boundaries rather than enabling all matches.

What do match indexes count?

Indexes are zero-based UTF-16 positions, matching JavaScript string indexing. Some visible symbols occupy multiple code units, so the index can differ from a visual character count.

You might also find useful

Install UtilBrix

Keep your tools one tap away on your home screen.

  1. Open your browser’s menu (⋮).
  2. Choose “Install app” or “Add to Home screen”.
  3. Confirm to add UtilBrix to your home screen.

If the install option is missing, open this page in Chrome on Android.

Search tools

↑ ↓ Navigate · Enter Open · Esc Close