ConvertUnlimited

Regex Tester

Test JavaScript regular expressions locally for validation, parsing, and debugging workflows.

Local developer validation tool

Test regex patterns safely.

Enter a pattern and sample text to highlight matches, preview replacements, and inspect capture groups with selected inputs processed locally in your browser.

Flags

Highlighted matches

What this tool does

Enter a pattern and sample text to highlight matches, preview replacements, and inspect capture groups with selected inputs processed locally in your browser.

Privacy behavior

Selected file contents are processed locally in your browser for supported workflows. This privacy build does not intentionally load ads, analytics, remote fonts, or third-party runtime scripts.

Supported workflow

Use the controls on this page, review the output in your browser, then copy or download the result.

When should you test regex?

Regex testing helps validate form input, parse logs, inspect API text, and debug extraction rules before using them in code.

This tool uses native JavaScript RegExp behavior and renders user text as text, not HTML.

The JavaScript regex flavor

This tester runs patterns through the native ECMAScript RegExp engine built into your browser, the same engine that runs .test(), .exec(), and String.replace() in JavaScript code. It is not PCRE, not POSIX, and not the Python re module; each of those differs from JavaScript in small ways, particularly around named groups, lookbehind, and Unicode property escapes, so a pattern copied from a different language's documentation does not always behave identically here.

FlagNameEffect
gGlobalFinds every match instead of stopping at the first. This tool always applies it internally.
iIgnore caseMatches letters regardless of case
mMultiline^ and $ match at the start and end of each line, not just the whole string
sDot all. also matches newline characters, which it otherwise does not
uUnicodeTreats the pattern as Unicode code points, enabling \u{...} escapes and stricter syntax validation

Common syntax tokens in this flavor:

TokenMeaning
\d \w \sDigit, word character, whitespace, each with uppercase negated forms \D \W \S
^ $Start and end anchors, or line boundaries with the m flag
* + ? {n,m}Quantifiers: zero or more, one or more, zero or one, or a custom range
(...) (?:...)Capturing group and non-capturing group
(?<name>...)Named capturing group
(?=...) (?!...)Lookahead and negative lookahead
(?<=...) (?<!...)Lookbehind and negative lookbehind, part of the specification though it shipped in browsers later than most other features

Worked example

The Sample regex button loads this pattern, text, and replacement:

  • Pattern: \b[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}\b
  • Text: Contact alice@example.com, bob@convertunlimited.com, and สวัสดี@example.co.th.
  • Flags: g and i checked
  • Replace with: [email]

This matches alice@example.com and bob@convertunlimited.com, two matches, and the replace preview becomes Contact [email], [email], and สวัสดี@example.co.th.. The third address is deliberately left unmatched: \w without Unicode property escapes only covers ASCII letters, digits, and underscore, so a local part written in Thai script never enters the character class, even with the u flag checked. Matching non-Latin local parts needs a different character class, such as one built from Unicode property escapes like \p{L}.

Limits and gotchas

  • The g checkbox does not change matching behavior. This tool always adds the global flag internally before building the regular expression, regardless of whether the g checkbox is checked, because iterating every match requires it. Checking or unchecking g in the UI has no visible effect on results or on the replace preview.
  • Replace preview always replaces every match. Because g is always active, Replace with never replaces only the first occurrence; a pattern that should only touch one match needs to be made more specific rather than relying on an unchecked g flag.
  • Matching stops after 1000 results. A pattern that matches far more than 1000 times in the test text, often a sign of an unintentionally broad pattern, only shows the first 1000 matches and stops there.
  • Test text over 200,000 characters skips matching entirely. Rather than running slowly on very large input, the tool shows a message and does not attempt to match at all past that size.
  • ^ and $ need the m flag for per-line matching. Without it, ^ and $ only match the very start and end of the whole test text block, not the start and end of each line, which is a common source of confusion when testing multi-line input.
  • No sticky flag in the UI. Only g, i, m, s, and u are offered as checkboxes; the y (sticky) flag, which anchors matching to lastIndex, cannot be applied through this interface.

Frequently Asked Questions

Is this Regex Tester free?

Yes. You can test patterns and preview replacements without signup.

Is my text sent to ConvertUnlimited servers?

No server-side upload endpoint is used for testing; patterns and text are processed locally in your browser.

Which regex engine is used?

It uses the native JavaScript RegExp engine in your browser.

Are invalid regex patterns handled?

Yes. The tool shows a friendly warning and preserves your input.

Does it support Unicode regex?

Yes. Check the u flag for Unicode-aware patterns, though \w and \d remain ASCII-only even with u checked unless the pattern uses Unicode property escapes.

Does unchecking the g flag limit matching to the first result?

No. This tool always searches globally internally, so unchecking g in the interface has no effect on how many matches are found or replaced.

Is there a limit on how many matches are shown?

Yes. Matching stops after 1000 results, and test text over 200,000 characters is skipped entirely to keep the page responsive.

Can I use $1 and other replacement patterns in Replace with?

Yes. The replace preview uses standard JavaScript String.replace semantics, so $1, $2, $&, and named group references work as they would in code.

Privacy

Privacy build: This build removes ads, analytics, remote fonts, runtime CDN scripts, and file-operation telemetry. Selected files are processed in the browser using local JavaScript and browser APIs.

ConvertUnlimited does not provide a server-side upload endpoint for this regex testing flow. Patterns and test text are processed locally in your browser.

Terms of Use

ConvertUnlimited is provided as is. Test expressions carefully before using them in production systems.

Privacy & processing

Trust and privacy

Files are processed locally where supported. Review the Trust Center for the processing model and the Privacy Policy for public-site privacy boundaries.