I'm having problems using the Find and Replace with Wildcards in Xcode. I found this post here: Xcode Wildcard characters?
However it is not working for me I'm thinking because of the older version of Xcode. I'm trying to find instances like these 3 different lines:
playerCardThirteenSlot = 6;
playerCardThirteenSlot = 7;
playerCardThirteenSlot = 8;
and in the find field am using
playerCardThirteenSlot = ([0-9]+);
which is not working. I just want to replace it with a blank string.
Can anyone help? Thanks!
Alternatively referred to as a wild character or wildcard character, a wildcard is a symbol used to replace or represent one or more characters. The most common wildcards are the asterisk (*), which represents one or more characters and question mark (?) that represents a single character.
Answer: The wildcard you're likely to use most frequently is the asterisk. It indicates that you want to search for any number of characters. For example, to search for all words beginning with “Th,” type “Th*” in the “Find What” box, and then click the “Find Next” button.
You need to set Regular expression mode
Step 1:
Step 2:
Enter the regular expression:
The selected text:
If part of what is being searched for includes regular expression special characters they must be escaped.
String to match for different last digits:
if ([compCardThirteenTitle isEqualToString:[compHandNamesArray objectAtIndex:12]])
if ([compCardThirteenTitle isEqualToString:[compHandNamesArray objectAtIndex:13]])
if ([compCardThirteenTitle isEqualToString:[compHandNamesArray objectAtIndex:14]])
Regular expression to match:
if \(\[compCardThirteenTitle isEqualToString:\[compHandNamesArray objectAtIndex:1[2-4]\]\]\)
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