Alex Rivera | Logout

iOS Regex: Unknown escape sequence "\|"

Asked 2012-07-11T21:56:09.070
17

I'm getting a weird warning, and as a result my regex search isn't working. Here's the line:

NSRange r = [HTML rangeOfString:@"\|(.*)\|" options:NSRegularExpressionSearch];

Where HTML is a string that I'm sure contains a single match for the above regex.

The warning is only on the first occurrence of "\|", not on both.

Any help is much appreciated!

Edit
Report

1 Answer

0

Just to add up, if you are dealing with special character sequences in unicode format, you can use something like this:

const unichar specialCharSequence='some special character';
if(specialCharSequence==L'\uxxxx')
{
   //handle the occurence of this special character
}
answered 2013-08-04T21:58:07.987

Your Answer