Skip to main content

Regex Converter

Regex Converter adapts patterns, flags, delimiters, and replacements between all supported regex flavors. Convert directly in the editor when you switch flavors, or open the converter to compare results and review changes.

Free
Convert any flavor to JavaScript
Pro
All target flavors and engine comparison
Self-hosted
Advanced regex bundle
Compare plans

Open the converter​

  1. Select the source flavor and enter your pattern.
  2. Open Regex Converter from the tools menu, or press Alt+Shift+C (Option+Shift+C on Mac).
  3. Select a target flavor to inspect its converted pattern and findings.
  4. Select Load … into editor to use that result and close the dialog.

In Substitution or Extraction mode, the converter also translates your replacement text. The table compares matches, replacements, and execution times for your enabled test strings.

Select a flavor to compare its pattern, replacement, results, and changes with the source.
Regex Converter comparing a log pattern with four named captures and a backreference across flavors.

Convert when you switch flavors​

When you switch flavors with a pattern in the editor, a toast offers conversion from the previous flavor to the new one.

  • Just once converts this pattern.
  • Always converts this pattern and enables automatic conversion for future switches.
  • Never turns off these prompts.

The conversion applies the pattern, flags, delimiter, and active replacement text directly in the editor. When values change, the result toast offers Undo. If conversion reports warnings or errors, Open converter shows the findings for the original source and selected target. The converter uses your current test strings. Undo restores the values from before conversion and keeps your new flavor selected.

Convert once, enable automatic conversion, or turn off the prompt.
Python syntax errors, the Explanation conversion offer, and the conversion toast after switching from PCRE2.

Choose Ask, Auto, or Never​

Open Settings → Editor → Conversion & output. Under When switching regex flavors, select:

  • Ask to show the conversion prompt. This is the default.
  • Auto to convert immediately and show the result.
  • Never to switch without a conversion prompt.

The settings link in the prompt opens this setting directly. If a flavor switch causes pattern errors, Try Regex Converter in the explanation offers conversion even after you dismiss the toast.

Switch to Python, inspect both conversion offers, then convert and preserve all three matching log records.

Try a conversion​

This PCRE2 example captures an order ID:

ORD-(?P<id>[0-9]{4})

Replacement:

Order \g<id>

Open in regex101

Open Regex Converter. Select JavaScript. The pattern becomes ORD-(?<id>[0-9]{4}), and the replacement becomes Order $<id>. The result is:

Order 0042 pending
Order 0187 sent

Choose a conversion mode​

Use Prioritize at the bottom of the converter:

  • Shorter pattern keeps compact syntax. This is the default.
  • Closer matching prefers equivalent rewrites, which can make patterns longer.

Both modes report known matching differences. Your choice applies to all conversions, including automatic conversion. You can also change it under Regex conversion mode in settings.

Check the result​

The converter lists changes, warnings, and errors for each target flavor. Compatible needs no changes. Converted contains changes. Approximate has known matching differences. Incompatible has unresolved errors.

If the toast shows Conversion Needs Review, select Open converter to inspect the findings. You can convert patterns with errors and load the result to correct the remaining problems in the editor.

Compare converted patterns and replacements across flavors, including an unsupported backreference.