fork download
  1. #import <objc/objc.h>
  2. #import <objc/Object.h>
  3. #import <Foundation/Foundation.h>
  4.  
  5. int main()
  6. {
  7. NSString *text = @"Это тестовый.!!?! ;$%#@@@## (вопрос) номер 1256 - верно";
  8. NSError *error = NULL;
  9. NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:@"[^\\p{L}\\p{M}0-9\\s-]+" options:NSRegularExpressionCaseInsensitive error:&error];
  10. NSString *result = [regexp stringByReplacingMatchesInString:text options:0 range:NSMakeRange(0, [text length]) withTemplate:@""];
  11. NSLog(result);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout #stderr 0.02s 42896KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2016-10-26 21:29:11.518 prog[22392] autorelease called without pool for object (0x94e95b8) of class NSRegularExpression in thread <NSThread: 0x94ab908>
2016-10-26 21:29:11.519 prog[22392] Это тестовый  вопрос номер 1256 - верно