Data and JSON tools Free · No sign-up · No upload

Regex Tester

Try a JavaScript regular expression on your text and see each match with its position, capture groups and named groups. Replace text, too. Your text stays in your browser.

  • Free, every time
  • No cloud processing
  • JavaScript syntax
  • Stops runaway patterns
Test text
JavaScript syntax, without the surrounding slashes
  • Runs on your device. Files are never uploaded.
  • Free and unlimited. No sign-up, no watermark.
Private: processed in your browserNo upload waitIN: Text → OUT: Matches
How was Regex tester?
How it works

Regex tester in three steps

No account, no email, no waiting for an upload.

  1. STEP 01

    Paste the text to search

    Add sample text or open a file.

  2. STEP 02

    Write the pattern and flags

    Type the expression without slashes, or as /pattern/flags. Tick g, i, m, s or u as needed.

  3. STEP 03

    Read the matches

    Each match shows its text, line, column, index range and groups. Turn on replace to preview the result.

What you get

What Regex tester does, and what it doesn't

We'd rather tell you up front than surprise you after the download.

What you get

  • Full match detailsText, position (line and column) and index range for every match, up to the first 1,000 listed, with the total count.
  • Capture groupsNumbered groups and named groups (?<name>...) are shown separately.
  • Replace previewUse $1, $<name> and $& in the replacement, and get the changed text as a second result.
  • Flagsg, i, m, s and u as checkboxes. You can also paste a literal like /\d+/gi.
  • Safety stopThe search runs in a background worker and is stopped after 5 seconds if the pattern backtracks without end.

Good to know

  • JavaScript regex onlyLookbehind works, but features unique to PCRE, Python or .NET (such as possessive quantifiers or inline modifiers) are not available.
  • Listing is cappedOnly the first 1,000 matches are listed in detail. The total is still reported.
  • No step-through debuggerYou see results, not the engine's steps. For heavy backtracking, simplify the pattern.
Private by design

Your data never leave your device

The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.

Typical online tool upload

Your device→Their server→Your device

Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.

Mediaextractr no upload

Your device does all the work

The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.

Made for real work

When people use Regex tester

Build a validation pattern

Try emails, IDs or dates against positive and negative samples.

Extract data from logs

Pull out timestamps, IPs or error codes with groups.

Bulk-replace text

Preview a search and replace before applying it in an editor.

Learn regular expressions

See exactly what each part matches.

Compare

Mediaextractr vs typical upload tools

MediaextractrPrivateTypical upload tools
Your file is uploadedNeverYes
Sign-up neededNoOften, after a few files
Daily file limitNoneOften 1–2 free files
WatermarkNeverSometimes
Wait for upload & downloadNoYes
Speed on very large filesDepends on your deviceDepends on their servers

Flags in brief

g finds all matches rather than the first. i ignores case. m makes ^ and $ match at each line, instead of only at the start and end of the whole text. s lets the dot match line breaks. u turns on full Unicode handling, which you want for emoji and for property escapes like \p{L}.

Avoiding slow patterns

Some patterns take exponential time on certain inputs, particularly nested repeats like (a+)+$. They can freeze a page. Here they are stopped after 5 seconds with a message, but better to avoid them:

  • Prefer specific classes like [0-9] over .* where you can.
  • Anchor patterns with ^ and $ when you intend a full match.
  • Avoid nesting quantifiers inside quantifiers.
  • After testing, you can run the same pattern in your code. For plain text comparisons use the text diff checker.

A first pattern

To pull dates out of text, try (\d{4})-(\d{2})-(\d{2}) with the g flag. Each match lists three groups. Turn on replace and enter $3/$2/$1 to reorder them into day, month, year. For named groups use (?<year>\d{4}) and refer to them as $<year>.

FAQ

Questions, answered

Which regex flavor does this use?

JavaScript, the same engine as your browser. Patterns that work here work in JavaScript code.

Is the text I test against uploaded?

No. The pattern runs in a background worker inside your browser, so log samples and customer text stay on your device.

How do I see capture groups?

They are listed under each match, numbered, and named groups appear with their names.

How do I use a replacement?

Tick 'Also replace matches' and enter text with $1, $<name> or $&.

Why was my pattern stopped?

It took more than 5 seconds, which usually means catastrophic backtracking. Make the pattern more specific.

Does it run on a phone or tablet?

Yes, on iOS and Android browsers. Typing slashes and brackets is easier with a hardware keyboard.