Tuesday, September 30, 2025

Explaining Regex Locally With Xcode

Paul Samuels:

My approach when needing to figure out what an old regex was doing was to paste it into whatever the top search result for “Explain regular expression” was.

Something that I’ve been doing for a while but hadn’t really thought about was using Xcode’s Refactor > Convert to Regex Builder as a way to explain a regular expression without having data leave my machine. Yes, it’s a shocker but one of Xcode’s refactoring tools actually works for me. It works surprisingly well and as a bonus gets those endorphins flowing knowing that my data is safe from some AI drivel.

[…]

Depending on your level of experience with regex you might think this is actually more wordy/overkill (in this case I’d agree) but the point is each part of the regex is broken out into smaller parts that have names explaining what they are doing.

And you can manipulate it using Code Folding.

Previously:

Comments RSS · Twitter · Mastodon

Leave a Comment