I am looking for a regular expression to match the following -100..100:0.01. The meaning of this expression is that the value can increment by 0.01 and should b
if(val>= -100 && val <= 100)
{
NSString* valregex = @"^[+|-]*[0-9]*.[0-9]{1,2}";
NSPredicate* valtest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", valregex];
ret = [valtest evaluateWithObject:txtLastname.text];
if (!ret)
{
[alert setMessage:NSLocalizedString(@"More than 2 decimals", @"")];
[alert show];
}
}
works fine.. Thnx for the efforts guys !