Regex Replacements
Power user feature: use regex patterns in Custom Words for advanced text transformations like ALL CAPS, spacing cleanup, and punctuation fixes.
How Regex Triggers Work
Prefix any Custom Words trigger with / and Speakmac treats it as a regex pattern. This unlocks pattern-based replacements instead of exact matches.
Quick Syntax Reference
/pattern/Regex trigger (the trailing / is optional)$0Full match. $1, $2... = capture groups\UPrefix replacement to uppercase the resultSetup
- 1Open Settings → Custom Words
- 2Add a trigger that starts with
/ - 3Add a replacement (use
$0,$1for captures,\Ufor uppercase) - 4Rules are case-sensitive and run in order
Essential Presets
ALL CAPS
Convert every word to uppercase.
/\b\p{L}+\b/\U$0Collapse Double Spaces
Turn multiple spaces into a single space.
/\s{2,}/(single space)Remove Space Before Punctuation
Fix transcription spacing around punctuation.
/\s+([,.!?;:])/$1Formatting Presets
Normalize Ellipses
Keep ellipses consistent at three dots.
/\.{3,}/...Hyphens to Em Dashes
Convert hyphens surrounded by spaces into proper em dashes.
/\s*-\s*/ — Percent Formatting
Convert spoken 'percent' to the % symbol.
/\b(\d+)\s?percent\b/$1%Cleanup Presets
Uppercase Acronyms
Keep common tech acronyms properly capitalized.
/\b(api|sdk|gpu|cpu|html|css|json)\b/\U$0Remove Filler Words
Strip common verbal fillers. Pair with double-space cleanup.
/\b(uh|um|like)\b/(single space)Troubleshooting
- •Invalid regex: Check your pattern syntax. Common issues: unescaped special characters, mismatched brackets.
- •Too aggressive: Add word boundaries
\bto limit matches to whole words. - •Order matters: Rules run in sequence. Put broad cleanup rules (spacing) after specific ones.
- •Case sensitivity: Regex is case-sensitive. Use
[Aa]to match both cases.
Need help with a custom regex? [email protected]
Ready to power up?
Download Speakmac
Get the app and unlock regex-powered text transformations.
Requires macOS 14+ and Apple Silicon.