{"id":49441,"date":"2025-09-30T16:18:07","date_gmt":"2025-09-30T20:18:07","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=49441"},"modified":"2025-09-30T17:12:57","modified_gmt":"2025-09-30T21:12:57","slug":"explaining-regex-locally-with-xcode","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/09\/30\/explaining-regex-locally-with-xcode\/","title":{"rendered":"Explaining Regex Locally With Xcode"},"content":{"rendered":"<p><a href=\"https:\/\/paul-samuels.com\/blog\/2025\/09\/28\/explaining-regex-locally-with-xcode\/\">Paul Samuels<\/a>:<\/p>\n<blockquote cite=\"https:\/\/paul-samuels.com\/blog\/2025\/09\/28\/explaining-regex-locally-with-xcode\/\"><p>My approach when needing to figure out what an old regex was doing was to paste it into whatever the top search result for &ldquo;Explain regular expression&rdquo; was.<\/p><p>Something that I&rsquo;ve been doing for a while but hadn&rsquo;t really thought about was using Xcode&rsquo;s <code>Refactor<\/code> &gt; <code>Convert to Regex Builder<\/code> as a way to explain a regular expression without having data leave my machine.\nYes, it&rsquo;s a shocker but one of Xcode&rsquo;s refactoring tools actually works for me.\nIt works surprisingly well and as a bonus gets those endorphins flowing knowing that my data is safe from some AI drivel.<\/p><p>[&#8230;]<\/p><p>Depending on your level of experience with regex you might think this is actually more wordy\/overkill (in this case I&rsquo;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.<\/p><\/blockquote>\n\n<p>And you can manipulate it using Code Folding.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2025\/07\/18\/xcode-key-bindings-to-make-refactoring-less-painful\/\">Xcode Key Bindings to Make Refactoring Less Painful<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/06\/10\/swift-regex\/\">Swift Regex<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>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 &ldquo;Explain regular expression&rdquo; was.Something that I&rsquo;ve been doing for a while but hadn&rsquo;t really thought about was using Xcode&rsquo;s Refactor &gt; Convert to Regex Builder as a way to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-09-30T20:18:10Z","apple_news_api_id":"9cfbf458-f7a2-46d8-a5dc-d5aa54b94281","apple_news_api_modified_at":"2025-09-30T21:13:00Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/AnPv0WPeiRtil3NWqVLlCgQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[30,2742,71,234,901,226],"class_list":["post-49441","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-mac","tag-macos-tahoe-26","tag-programming","tag-regex","tag-swift-programming-language","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=49441"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49441\/revisions"}],"predecessor-version":[{"id":49444,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49441\/revisions\/49444"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=49441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=49441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=49441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}