How to find and replace a WildCard number in Xcode

I'm having problems using Find and Replace with Wildcards in Xcode. I found this post here: Xcode character characters?

However, this does not work for me. I think because of the older version of Xcode. I am trying to find instances similar to these three different lines:

playerCardThirteenSlot = 6;
playerCardThirteenSlot = 7;
playerCardThirteenSlot = 8;

and in the search box am using

playerCardThirteenSlot = ([0-9]+);

which does not work. I just want to replace it with an empty string.

Can anyone help? Thanks!

+4
source share
1 answer

You need to set the regular expression mode
Step 1:

Step 2:

Enter regex:

Selected Text:

, . :

if ([compCardThirteenTitle isEqualToString: [compHandNamesArray objectAtIndex: 12]])
if ([compCardThirteenTitle isEqualToString: [compHandNamesArray objectAtIndex: 13]])
if ([compCardThirteenTitle isEqualToString: [compHandNamesArray objectAtIndex: 14]])

:

if \(\[compCardThirteenTitle isEqualToString:\[compHandNamesArray objectAtIndex:1[2-4]\]\]\)
+5

All Articles