这是代码
NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)" options:NSRegularExpressionCaseInsensitive error:&error];
Run Code Online (Sandbox Code Playgroud)
代码本身有效,但会发出以下警告:
"Unknown escape sequence \."
Run Code Online (Sandbox Code Playgroud)
我也尝试过这些选项:
NSRegularExpressionCaseInsensitive|NSRegularExpressionAnchorsMatchLines
Run Code Online (Sandbox Code Playgroud)
但仍然存在错误.任何人都可以解释为什么会出现此错误以及如何删除它.