Replacing numbers in an NSString with Objects from NSArray
问题 In a UITextView users can enter numbers formatted like {{1}} or {{177}} . In a preview field, much like here on SO I'd like to replace that pattern with a value from an NSArray, where the number corresponds to the row in the array. I have two ideas to solve this: Count all occurrences with an NSRegularExpression, loop through them and replace them. Create a word-array out of the NSString and loop through the array, replacing occurrences and put the NSString back together. Which of those two