fork(3) download
  1. #import <objc/objc.h>
  2. #import <objc/Object.h>
  3. #import <Foundation/Foundation.h>
  4.  
  5. @implementation TestObj
  6. int main()
  7. {
  8. NSString *phraseLabelWithBrackets = @"(test text) 1 2 3 text test";
  9. NSError *error = NULL;
  10. NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:@"\\([^()]+\\)" options:NSRegularExpressionCaseInsensitive error:&error];
  11. NSString *phraseLabelWithoutBrackets = [regexp stringByReplacingMatchesInString:phraseLabelWithBrackets options:0 range:NSMakeRange(0, [phraseLabelWithBrackets length]) withTemplate:@""];
  12. NSLog(phraseLabelWithoutBrackets);
  13. return 0;
  14. }
  15. @end
Success #stdin #stdout #stderr 0.03s 42888KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2016-04-29 12:59:27.002 prog[25259] autorelease called without pool for object (0x97274c0) of class NSRegularExpression in thread <NSThread: 0x96e9800>
2016-04-29 12:59:27.004 prog[25259]  1 2 3 text test