(REGEX) Regular expression to replace all in Xcode 5

I have about 1,300 copies

#import <xxxxx/ClassName.h> 

which I would like to replace with

 #import "ClassName.h" 

I noticed that if I use the cmd-shift-f menu, I can go to Replace> Regular Expression. The class Name is not unique; xxxxx is always the same.

What is a regular expression that will replace all of these?

+6
source share
1 answer

In Xcode 5:

How to find the line:

 #import <xxxxx/(\w+\.h)> 

How to Replace a string:

 #import "\1" 



In Xcode 6:

Note. Behavior has changed in Xcode 6 . The syntax \1 been replaced with $1 . Also keep in mind that newlines can now be matched in regular expressions, so be sure to skip before performing the Replace All operation.

+12
source

Source: https://habr.com/ru/post/955797/


All Articles