- change validation for new domain extensions

This commit is contained in:
Giuseppe Nucifora 2016-02-19 14:04:30 +01:00
parent 200b31d0a0
commit 74f5ace0e8
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "NSString-Helper" s.name = "NSString-Helper"
s.version = "1.0.2" s.version = "1.0.3"
s.summary = "NSString-Helper is usefull helper to validate email NSString" s.summary = "NSString-Helper is usefull helper to validate email NSString"
s.homepage = "https://github.com/giuseppenucifora/NSString-Helper" s.homepage = "https://github.com/giuseppenucifora/NSString-Helper"
s.license = 'MIT' s.license = 'MIT'

View File

@ -13,7 +13,7 @@
- (BOOL) isValidEmail - (BOOL) isValidEmail
{ {
BOOL stricterFilter = YES; BOOL stricterFilter = YES;
NSString *stricterFilterString = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSString *stricterFilterString = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,15}";
NSString *laxString = @".+@.+\\.[A-Za-z]{2}[A-Za-z]*"; NSString *laxString = @".+@.+\\.[A-Za-z]{2}[A-Za-z]*";
NSString *emailRegex = stricterFilter ? stricterFilterString : laxString; NSString *emailRegex = stricterFilter ? stricterFilterString : laxString;
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];