fork(3) download
  1. #import <objc/objc.h>
  2. #import <objc/Object.h>
  3. #import <Foundation/Foundation.h>
  4.  
  5. int main()
  6. {
  7. NSError *error = nil;
  8. NSString *input = @"abc^ 123 # //> <";
  9. NSString *pat = @"[~#^/<>]";
  10. NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pat options:nil error:&error];
  11. NSString *modifiedString = [regex stringByReplacingMatchesInString:input
  12. options:0
  13. range:NSMakeRange(0, [input length])
  14. withTemplate:@"~$0"];
  15. NSLog(@"%@", modifiedString);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout #stderr 0.01s 128640KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2017-10-17 19:08:23.019 prog[18299:18299] autorelease called without pool for object (0x158fed0) of class NSRegularExpression in thread <NSThread: 0x159a880>{name = (null), num = 18299}
2017-10-17 19:08:23.019 prog[18299:18299] autorelease called without pool for object (0x164c500) of class NSCalendarDate in thread <NSThread: 0x159a880>{name = (null), num = 18299}
2017-10-17 19:08:23.019 prog[18299:18299] autorelease called without pool for object (0x1694d50) of class GSDictionary in thread <NSThread: 0x159a880>{name = (null), num = 18299}
2017-10-17 19:08:23.019 prog[18299:18299] autorelease called without pool for object (0x16a0d20) of class GSTimeZone in thread <NSThread: 0x159a880>{name = (null), num = 18299}
2017-10-17 19:08:23.019 prog[18299:18299] autorelease called without pool for object (0x163bf90) of class GSCInlineString in thread <NSThread: 0x159a880>{name = (null), num = 18299}
2017-10-17 19:08:23.019 prog[18299:18299] autorelease called without pool for object (0x169ec70) of class NSDataMalloc in thread <NSThread: 0x159a880>{name = (null), num = 18299}
2017-10-17 19:08:23.019 prog[18299:18299] abc~^ 123 ~# ~/~/~> ~<