Find/Replace in Xcode using Regular Expression

前端 未结 6 1603
不思量自难忘°
不思量自难忘° 2020-12-04 10:43

I have the following function calls at several places in my class.

[myClass doOperationOne];
[myClass doOperationTwo];
[myClass doOperationThree];

6条回答
  •  再見小時候
    2020-12-04 11:35

    Somehow I've managed to find the answer (which is enough for my need here) by referring the post: http://www.cocoabuilder.com/archive/xcode/273123-how-to-use-regular-expressions-in-xcode-find-replace.html, and trial and error method.

    My Find string is:

    (\[myClass.myMethod )(.*)(\];)
    

    And, my Replace string is:

    \1\2WithOptions:[Permissions isOptionsAvailable]\3
    

    Please post if there is any better way than this..

提交回复
热议问题