title: Email validation not working in some test cases in iOS
body: <p>I want to validate the email in iOS.  I've written a category class and here's my code but in some cases like <strong>abc@gmail.com.com</strong> it's not working...</p>
  
  <p>If the user type two times .com or .in continuously it is not detecting it...</p>
  
  <p>I tried with some solutions but that also not working.  That's why am asking here</p>
  
  <pre><code>- (BOOL)isValidEmail {
     NSString *emailString = [self stringByTrimmingCharactersInSet:   [NSCharacterSet whitespaceAndNewlineCharacterSet]];
  
     BOOL isValid = YES;
     BOOL sticterFilter = YES;
  
     NSString *stricterFilterString = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
     NSString *laxString = @".+@.+\\.[A-Za-z]{2}[A-Za-z]*";
  
     NSString *emailRegex = sticterFilter ? stricterFilterString : laxString;
     NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
  
     if (![emailTest evaluateWithObject:emailString]) {
        isValid = NO;
     }
  
     return isValid;
  </code></pre>
  
  <p>}</p>