-3

I just found someone using a regex like this:

NSString *pattern = @"i[\\p{Alphabetic}&&\\p{Uppercase}][\\p{Alphabetic}]+";
[NSRegularExpression regularExpressionWithPattern:pattern options:0 error:NULL];
// Source: http://www.objc.io/issue-5/getting-to-know-textkit.html
// Tested. It actually works.

The regular expression looks pretty cool and readable (supposedly more compatible with Unicode). Where can I find more info on this kind of regex? Is it a Cocoa-only kind of thing?

EDIT: I found a comprehensive answer here.

Community
  • 1
  • 1
Khanh Nguyen
  • 11,112
  • 10
  • 52
  • 65

1 Answers1

0

I guess (might be totally wrong), that this kind of regularExpression is used with UNICODE PROPERTY NAME expression, as you already mentioned. You can use it with the NSRegularExpression class.

References can be found here from the apple developer page. And secondly from the unicode.org page.

Hope this helps.

rogaa
  • 370
  • 2
  • 16
  • 1
    If you might be totally wrong, you probably should check before answering! – Docteur May 12 '15 at 06:44
  • I did, so I *risked* to add an answer, but mentioned it. – rogaa May 12 '15 at 06:46
  • 1
    The Unicode TR18 page is not intended for people who uses regex engine, I think it is meant for people developing an engine yourself, or for people who want to know what a Unicode regex engine should support. For iOS, it uses ICU regex, so this is a much better documentation for people who use regex engine: http://userguide.icu-project.org/strings/regexp – nhahtdh May 12 '15 at 06:57