I'm sorry if this is an overly specific question. Tried searching for basic help with NSPredicate and getting nowhere.
I'm trying to validate a string that should begin with a particular word (let's say it's SPOT, in all caps) and is followed by exactly 4 numeric digits.
In other words, for example, SPOT1234 or SPOT0483 would pass validation. SPAT1234, spot1234, SPOT123 or any other string would fail.
Can anyone point me in the right direction?
You can use an NSPredicate with a regular expression.
The resultsArray will contain two strings: SPOT1234, SPOT0483