Home > Coding > Using regex to replace a path

Using regex to replace a path

February 8th, 2010

This is for me, not you, a reference for me. So if you are wondering why I wrote this… it’s because it’s for me.

Here is a regex string I used in TextWrangler to search and replace paths in a Xcode project file… you know, the one that is inside the .xcodeproj bundle…

Search string:
\.\./\.\./development/.+/mac/macos_10\.4/dylib/

Replace with:
Whatever you like…

Jaime Coding ,

  1. zack
    February 9th, 2010 at 07:31 | #1

    Editing the project file is asking for trouble. Why not just use Xcode’s built in search to find the strings in the project build settings?

  2. Jaime
    February 9th, 2010 at 11:01 | #2

    Now what’s the fun of having a SCM if you don’t mess up files occasionally? … Kidding … Kidding!

    Actually, my co-worker warned me of that already. Thankfully, the project I was working with, or I should say projects, were all non-production stuff, each one which had at least 5 targets…

    So, you see I had motivation to use the nasty approach instead of the click-click-double-click-times-300 approach.

  1. No trackbacks yet.