Regex for macOS: Mac Regex Tester
Mac regex tester and editor
For macOS 14.2 and later.
I use Regex 2.4.2 to test Swift Regex patterns locally, inspect captures, and preview replacements without changing the text I pasted. This focused native scratchpad shows whether a pattern is empty, invalid, valid with zero matches, or matching as I type.

Testimonials
Fast, simple and to the point
★★★★★
This app is awesome and easy to use. It not only does its job well, but helps me learn about regular expressions.
Like the new, clean look of the app
★★★★★
I like the new, clean look of the app. It's a vast improvement over the previous UI. Also fixes many of the issues I had with it.
What Regex 2.4.2 does
- Shows separate empty, invalid, zero-match, and matching states
- Highlights all matches or capture groups 0 through 8
- Supports case-insensitive (
i), dot-matches-newlines (s), and multiline-anchor (m) options - Previews
$0through$8replacements live in a read-only result - Escapes backslashes and quotes when copying, then unescapes them when pasting
- Optionally recovers one workspace from the app sandbox; recovery is off by default
- Runs in English, German, French, Japanese, Simplified Chinese, and Latin-American Spanish

When to use it
I use Regex for macOS as a focused native scratchpad before moving a pattern into Swift, grep, sed, nginx, an editor, or another tool. It tests Swift Regex. It is not a multi-engine tester, AI tool, pattern generator, library, diagrammer, batch processor, or destructive replacement tool.
Patterns, Test Data, and replacement previews are processed locally in the app. Regex has no uploads, account, cloud sync, network service, or app analytics. The MotionObj website uses its existing Clicky and PostHog analytics.
If you are taking a pattern to Terminal, start in the app, then copy it into grep -E on macOS. The Regex for macOS Tutorial walks through the same workflow with examples.
Details to check before pasting a regex elsewhere
Regex for macOS currently matches patterns with Swift’s Regex engine. That is useful if the final destination is Swift, but it does not mean every pattern will behave the same in every tool. I still check the destination when the pattern is going into:
- Swift code, especially if I am deciding between a plain regex,
NSRegularExpression, andRegexBuilder - macOS
sed -E, where replacement syntax and shell quoting matter - nginx rules, where location matching and rewrite captures have their own rules
The app helps with the first pass: sample text, matches, capture groups, matching options, and escaped copying. It is not a multi-engine compatibility tester, so I still run the final command or code path before using a regex on important data.

FAQ
What is the difference between an invalid pattern and zero matches?
An invalid pattern cannot be parsed, so Regex shows the error. A valid pattern with zero matches parsed correctly but did not match the current Test Data.
Does the replacement preview edit Test Data?
No. The live replacement preview is read-only. It never changes the text in Test Data.
Where is workspace recovery stored, and how do I clear it?
Recovery is off by default. If I turn it on, Regex stores one workspace locally in the app sandbox on this Mac. I can clear the saved workspace at any time or turn recovery off; local device backups may include sandbox data.
Does my data leave the app?
No. Regex processes patterns, Test Data, and replacement previews locally. The app has no uploads, account, cloud sync, network service, or app analytics.
Which regex engine does the app test?
Regex tests Swift Regex behavior. I still check the final destination because grep, sed, nginx, other engines, string escaping, and replacement syntax can behave differently.