Security & Developer Tools

Regex Tester & Builder

Test, explain, compare, and transform regular expressions without sending your text to a server.

Loading, please wait…

Related tools

Find and inspect matches

Enter a JavaScript pattern, choose flags, and paste sample text. Regex Studio highlights matches without changing the input and shows UTF-16 offsets, line numbers, numbered captures and named groups. An unmatched optional group is different from a group that matched an empty string.

Replace and extract text

Preview a replacement before downloading it. JavaScript replacement tokens include $1, $<name> and $&. Extract full matches and captured fields into rows, then export CSV, TSV, JSON or JSON Lines. CSV export protects cells that begin like spreadsheet formulas.

Work with examples and real files

Add positive and negative test cases before changing a pattern. The Explain view describes supported syntax; the Builder assembles escaped components, and From Examples proposes candidates for you to review. Compare checks two expressions on a sample corpus. Open TXT, LOG, CSV, TSV, JSON or JSONL files locally and select a field for batch extraction or a processing pipeline. Whole-text and row modes differ: anchors and cross-line matches apply to each chosen unit.

Practical patterns

How it works

  1. Enter a pattern or choose an offline recipe, then select JavaScript flags.
  2. Provide sample text or open a local file. Inspect matches and capture groups.
  3. Choose Replace, Extract, Split, Tests, Compare or Pipeline and review the result.
  4. Copy or download your output. Files are never uploaded for regex processing.

Engine and privacy limits

Matching uses the JavaScript RegExp implementation in your browser, inside a worker that can be stopped or timed out. JavaScript is not identical to PCRE2, Python or Go regex; code snippets for other languages require testing in their actual runtimes. A warning about slow syntax is a heuristic, not proof that a pattern is safe. The live editor limits input and result previews so long or expensive patterns do not overwhelm the page. Your content is not saved persistently unless you choose Save locally or export it.

Questions

Is my text uploaded?

No. Pattern execution and file parsing happen in your browser. Static site assets may load from Mekh Tools, but input and file content is not sent to the server for processing.

Can I extract named capture groups?

Yes. Use a group such as (?<order>ORD-\d{4}), then review the Extract table or export it as CSV, JSON or JSON Lines.

Does this support PHP or Python syntax?

The matching engine is JavaScript. Generated snippets for other languages are starting points with compatibility warnings; those runtimes are not executed by this page.

Can a regex prove an email address is valid?

No. A regex can find email-like text, but complete validation depends on the application's rules and often needs more than a pattern.

Continue your workflow

Selected files are processed locally on your device and are not uploaded to our application server.