How is it possible to perform a matching of string, just like regex?
For example i have an array of strings, I want to match if these string is in the format of "abc def xxx", which xxx is number like 1, 11, 12, 100, 111, etc.
How can I achieve this?
The arrays:
The regular expression:
To check if all strings in the array matche the regex:
All objects in array1 matches the regex, but array2 contains the string @”abc def 5367″ which doesn’t match the regex.
To get the matched strings:
To get the unmatched strings:
Note that here “description” in predicate is the
- descriptionmethod of NSString.