I want to check the email text for which I am using RegexKitLite.h . I do the following:
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'm just checking if this works. But in the second line I get an error. The magazine says nothing. But in the second line there is a warning saying:
Unknown escape sequence '\.'
What could be the problem? Is there something wrong in the expression or is there some other problem?
Thanks,
Nitish
source share