In my code I make extensive use of regular expression, and my patterns look something like this
regexp = [[NSRegularExpression alloc] initWithPattern:@".*?\\\+.*?\\\+.*?\\\+.*?\\\+.*?\\\+.*?\\\+" options:0 error:nil];
For the escape sequences I get compiler warnings like “Unknown escape sequence +” which is extremely annoying because it is not wrong in my case. How can I get rid of this warning?
You have to many back-slash characters, use:
To get a
\in a string it needs to be escaped:\\. So\\\+applies the first\to escaping the second\and the third\tries to escape the plus sign+which is an illegal escape.