iOS Regex: Unknown escape sequence “\|”

前端 未结 2 464
说谎
说谎 2020-12-30 03:26

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:NSReg         


        
2条回答
  •  难免孤独
    2020-12-30 04:13

    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
    }
    

提交回复
热议问题