The regular expression workbench

See what your regular expression does.

Dotstar builds, tests and explains regular expressions in the real engines of JavaScript, PHP, Python, Go, .NET and Java, and with Pro twelve more, from Rust and Ruby to Perl, Swift, Google’s RE2, ICU and, for old code, VBScript. It writes the code for 24 languages. On your computer, with nothing you type leaving it.

Version 0.9.18 · For Mac, Windows and Linux, and in your browser

Dotstar with a pattern for log lines: its matches highlighted in the text, and every part of it explained in the side panel.

Try the explanation

Type a pattern, or edit this one. Point at a row to see its part of the pattern; change the flavor to read it as that language does.

Real engines, not imitations

Each flavor runs its own engine: PCRE2 as in PHP, Go’s regexp, Python’s re, .NET’s Regex and Java’s java.util.regex, built into Dotstar, and JavaScript in the engine of your computer or browser. What matches in Dotstar matches in your code, corner cases included.

Switch flavor and Dotstar offers the pattern converted, and says plainly what doesn’t carry over.

Dotstar Pro adds more engines: Rust’s regex crate, POSIX (ERE and BRE, as in grep and sed), C++’s std::regex in all six of its grammars, Lua’s patterns, Vim’s own regular expressions, Ruby’s, Perl’s and Swift’s, Google’s RE2 (as in Google Sheets and BigQuery), ICU’s (as NSRegularExpression and MySQL run it), Emacs’s, as Emacs*, and for old code VBScript’s (VB6, VBA and VBScript), as VBScript*, with more to come; and Pomsky, a regular expression language written to be read, compiled into any of eight of them. Emacs* is Dotstar’s own engine, not GNU Emacs: written from how Emacs behaves and checked against Emacs 31; the desktop app from this site (not the App Store’s) can run an installed GNU Emacs instead.

A JavaScript pattern offered converted to Python, with its named groups and backreference rewritten.

Matches as you type

Matches and their groups light up in the text as you type, and the Matches tab lists them as details, lines, values or a table of groups. Turn on Replace and the replaced text appears beside it, each replacement marked.

Keep test cases, strings that should match and ones that shouldn’t, and see at a glance when a change breaks one.

Log lines with every match highlighted, and the Matches tab showing a table of named groups.

Step through the engine

The debugger walks through a match one step at a time: what the engine tries, where it fails and where it backtracks, marked in the pattern and in the text.

A pattern that can backtrack catastrophically, like (\w+\s?)+, is underlined as you write it, with why, and a safer form one click away where there is one.

The debugger halfway through a match, with a warning that the pattern can backtrack catastrophically.

Code you can paste

The Code tab writes the pattern into code for 24 languages, from Rust and Swift to PowerShell, C, Lua, Vim script, Emacs Lisp, VBA and sed, with the escaping and flags each one needs. Where Dotstar has that language’s engine, it runs the code’s pattern there and tells you it finds the same matches.

It works the other way too: paste a line of code into the pattern and Dotstar offers the pattern in it, with its flags.

Python code for a JavaScript pattern, checked in Python’s own engine.

Every engine at once

Compare runs the pattern in every engine side by side, grouped by what they find, and shows where they disagree: which ones read \w as ASCII and which as Unicode, which ones don’t know the syntax at all. As written, or converted to each.

The pattern \b\w+\b in 24 engines, in four groups: six matches as in JavaScript, four whole words in Python, .NET and others, none in Lua, POSIX BRE and Vim, one in Ruby.

Chain steps after the pattern

The Chain tab runs steps on what the pattern made, each on the output of the one before: a replace keeps what it doesn’t match, an extract keeps only the matches, written from a template. Tidy a log, pull out what matters and reshape it, in one place, with every step’s count beside it.

Log lines replaced by the pattern, then a chain of two steps, an extract and a replace, that leaves the two failed requests as HTTP 404 and HTTP 500 lines.

Suggestions as you type

After a backslash or a parenthesis, the syntax your flavor has, each with what it means, and the pattern’s groups in the replacement.

Files and folders

Search a whole folder, with filters, and replace in every file at once. The originals are kept, and Undo puts them back byte for byte.

A library

Ready-made patterns for dates, emails, URLs and more, and your own, saved with their test cases and a sample text.

Projects and links

Save the whole investigation as a project, or share it as a link that holds everything after the #, which never reaches a server.

Nothing you type leaves your computer

Matching, explaining, debugging and searching files all happen on your computer. Dotstar collects nothing and needs no account. The desktop app asks getdotstar.com only whether there’s a new version, and with Pro whether its license is still good. See Privacy.

Free and Pro

Dotstar is free to download and to use. Pay once, and Pro is yours, with every update: no subscription.

Free Pro
All six flavors, with their real engines ✓ ✓
Explanation, Insert, matches, Replace, Collect, test cases ✓ ✓
Backtracking warnings, pattern from code, links, suggestions as you type ✓ ✓
Compare: the pattern in every engine at once The six Free engines Every engine, also converted
Debugger Texts up to 200 characters Up to 100,000
Code In the flavor’s own languages All 24 languages, converted
Library The ready-made patterns, and 20 of your own No limit; import and export
Text files Up to 1 MB Up to 50 MB
Converting a pattern between flavors – ✓
More engines: Rust, POSIX ERE and BRE, C++’s std::regex, Lua, Vim, Ruby, Perl, Swift, RE2, ICU, Emacs*, VBScript*, Pomsky, and those to come – ✓
Files: search and replace in folders – ✓
Saving projects – ✓

The web version is Dotstar Free, in your browser. Files and Pro are in the desktop app.

Emacs* is Dotstar’s own engine for Emacs’s regular expressions, not GNU Emacs, nor affiliated with it; VBScript* its own for VBScript.RegExp, not Microsoft’s.

Questions

Is it really my language’s engine?

Yes. PCRE2 (the engine in PHP), Go’s regexp, Python’s re, .NET’s Regex and Java’s java.util.regex are the real libraries, built into Dotstar and run on your computer, and so are Pro’s Rust, Ruby, Perl, Swift and the others (Emacs* and VBScript* aside, which are Dotstar’s own). JavaScript runs in the engine of your computer or browser.

Does anything I type leave my computer?

No. Dotstar works offline, collects no data and has no account (activating a Pro license key bought outside the App Store sends the key and this computer’s name, once). A link you share keeps the pattern after the #, which browsers never send to a server. See the privacy policy.

What does the web version do?

It is Dotstar Free, the same app in your browser: the six Free engines, the explanation, matches, Replace, Collect, test cases, the debugger and the Code tab, with Free’s limits (see Free and Pro above). Pro’s engines, converting between flavors, Files and saving projects are in the desktop app, with Pro.

Which computers does it run on?

Macs with macOS 13 Ventura or later, on Apple silicon and Intel; Java’s engine needs Safari 18.4’s web engine, which macOS updates bring.

Linux on x86-64 and Arm, as a .deb, an .rpm or an AppImage; Flathub is coming. See the downloads.

Windows 10 and 11 on x64, as an installer or an MSI; the Microsoft Store is coming. See the downloads.

Is Pro a subscription? Do updates cost extra?

Neither. Pay once, and Pro is yours, with every update after it, and it keeps working offline.