How can I detect if a certain NSString contains a string format like this for example:
I would like to check if a string is in a certain format. For example if I have the string format, @"%d %d/%d %@", I would like my code to return YES if I compare it against @"1 1/2 oz", and like wise would return NO if I compared it against @"20 ml".
What you want to use are regular expressions. The regex for this specific case is
Try using NSRegularExpression.
Here’s also a regex tutorial.