Hello Every one.
I want to use regex for the following expression.
here mail id can be any thing. but I just want to cut this string.
I was trying following code.
NSString *email=@"<a href=\"mailto:[email protected]\">";
NSString *strEmailMatchstring= @"\\b([a-zA-Z0-9%_.+\\-]+)@([a-zA-Z0-9.\\-]+?\\.[a-zA-Z]{2,6})\\b";
if(![email isMatchedByRegex:strEmailMatchstring]){
av=[[[UIAlertView alloc] initWithTitle:@"Message" message:@"Invalid Email-ID." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease]; [av show]; return NO;
}
I know it is wrong. I have placed the regex of checking mail id. I just want to But I don't know about regex.
What should be the correct way?
Thanks in advance for sharing your knowledge.