I need the regex formula for
ex “17% off etc etc”
or “2% off etc etc etc”
so if the string starts with a one or 2 digit number followed by the percent sign, space, and the word ‘off’
I tried
NSPredicate* test = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", @"^[0-9]{1,2}% off"];
if ( [test evaluateWithObject:candidate] )
{
.... etc..
but no luck.
I appreciate any insight.
With this command line example app it works just fine.
output:
If the line contains more chars, it should look like
the
.*indicates, that any number of any char might be present.