Utility Tools logo

UtilityBox – Free Online Utility Tools

Smart tools for daily tasks — no sign-up needed

Regex Tester

Validate regex patterns and inspect matching results.

Regex Tester Online – Test JavaScript Regular Expressions

UtilityBox's regex tester lets you check a JavaScript regular expression against your own sample text without installing anything. Type the pattern, add any flags (for example gi), paste the test text and click Run Regex: the tool lists every match with the character index where it starts, or tells you that nothing matched or that the pattern is invalid. Matching uses the browser's native RegExp engine in a background Web Worker, so a runaway pattern is stopped after 2 seconds instead of freezing the page. Your pattern and text are never sent to a server.

How to Use the Regex Tester

  1. Type your pattern into the Regex pattern field without the surrounding slashes, e.g. \d{3}-\d{4}.
  2. Type any flags into the Flags field, e.g. g to find every match or gi to find every match ignoring case. Leave it empty for a single, case-sensitive match.
  3. Paste or type the text to search into the Test text box.
  4. Click Run Regex.
  5. Read the summary line (e.g. "3 match(es)") and the list below it, which shows each matched string and the index where it starts. If the pattern or flags are invalid, the error message is shown instead.

Key Features

  • JavaScript's native RegExp engine — the same syntax as modern browsers and Node.js, including lookaheads, lookbehinds and named groups in patterns.
  • Any flag combination typed as text: g, i, m, s, u and y.
  • Match list showing every matched string and its start index.
  • Match count in the summary line, with clear "No matches" and "Invalid regex pattern/flags" messages.
  • 2-second timeout — matching runs in a Web Worker, so catastrophic backtracking such as (a+)+ is stopped instead of hanging the tab.
  • Lists up to 10,000 matches per run.
  • Multi-line test text — paste log lines, CSV rows or any block of text.
  • Runs in your browser — your pattern and text are not uploaded. Free, no sign-up.

Common Use Cases

  • Form validation patterns: Build patterns for email addresses, phone numbers, postal codes or URLs. Paste valid and invalid samples one per line, add the g and m flags, and check that only the expected strings appear in the match list before you put the pattern in your validation code.
  • Log analysis and data extraction: Paste a block of log lines and test a pattern for timestamps, IP addresses or HTTP status codes. The match list and indexes show exactly what the pattern would pull out, so you can move it into a script or monitoring query with confidence.
  • Find-and-replace checks: Before a bulk search-and-replace in an editor or shell script, run the find pattern against a representative excerpt and confirm it matches what you intend — and nothing else.
  • Learning regular expressions: Experiment with quantifiers (*, +, ?, {n,m}), anchors, character classes and alternation. The match list and error messages show what each change to the pattern does.

Frequently Asked Questions

What regex engine does this online regex tester use?

It uses JavaScript's native RegExp engine, the same one built into your browser. It supports ECMAScript syntax such as lookaheads, lookbehinds, named and non-capturing groups, and Unicode property escapes with the u flag. A pattern that works here behaves the same way in other modern JavaScript environments such as Node.js.

Which regex flags does this regular expression tester support?

Type any combination into the Flags field: g (global — every match, not just the first), i (case-insensitive), m (multiline — ^ and $ match at each line), s (dotAll — the dot also matches newlines), u (Unicode) and y (sticky — match only at the current position). The flags are passed straight to JavaScript's RegExp, so an unknown or repeated flag shows an "Invalid regex pattern/flags" message.

Does this JavaScript regex tester show capture groups?

No. For each match it shows the full matched text and the index where it starts. Capture groups — numbered ($1, $2) or named — still work inside your pattern, but their individual values are not listed.

Is this regex validator online completely free?

Yes. There is no account and no sign-up. The regex runs in your browser, so your pattern and test text are not sent to a server. To keep the page responsive, one run lists at most 10,000 matches and stops after 2 seconds.

What happens if my regex is too slow?

Run Regex executes the pattern in a background Web Worker. If matching takes longer than 2 seconds — usually catastrophic backtracking caused by nested quantifiers like (a+)+ — the worker is stopped and the tool reports "Timed out — pattern too complex", so your tab never freezes. Simplify the pattern and run it again.

Can I test regex against multi-line text in this online regex checker?

Yes. Paste any amount of text, including multiple lines, into the Test text box. Add the m flag so ^ and $ match at the start and end of each line, and the s flag if the dot should also match newline characters.

What is the difference between the g flag and no flag in a regex pattern tester?

Without g, the tester reports only the first match. With g, it keeps scanning and lists every non-overlapping match in the text, each on its own line with its index. The summary line shows how many matches were found.

Does this regex tester online work with Unicode and special characters?

Yes. Add the u flag for full Unicode code-point matching, so characters outside the Basic Multilingual Plane such as emoji are treated as one character, and to use property escapes like \p{Letter} or \p{Script=Latin}. Without u, those escapes are not available and an emoji counts as two separate code units.