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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With