Reputation: 14965
I have about 1,300 instances of
#import <xxxxx/ClassName.h>
that I'd like to replace with
#import "ClassName.h"
I noticed if I use the cmd-shift-f menu I can go to Replace > Regular Expression. The ClassName is not unique, xxxxx is always the same.
What is the regular expression that will replace all of those?
Upvotes: 6
Views: 2653
Reputation: 135752
As Find string:
#import <xxxxx/(\w+\.h)>
As Replace string:
#import "\1"
Note: The behavior changed in Xcode 6. The \1
syntax was replaced with $1
. Also keep in mind that newlines can now be matched in regular expressions, so make sure to skim before doing a Replace All.
Upvotes: 13