I want to validate email text for which I am using RegexKitLite.h
. I am doing things as follows :
NSString *strEmail = [txtEmail text];
NSRange range = [strEmail rangeOfRegex:@"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"];
NSLog(@"%@",range);
For now I am just checking if this works. But I am getting error in second line. Log doesn't say anything. But there is a warning in second line which says :
Unknown escape sequence '\.'
What might be the problem? Is there something wrong in expression or is there some other issue?