fork 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 * string = @"2015-11-23 13:51:43.477 Unobfuscater[6577:3235202] @maven46 hey we have multiple travel clients including one global brand. dm me or ross[at]http://content-available-to-author-only.co/3pnlwlwmvo if you want to chat :-)\n2015-11-23 13:51:43.477 Unobfuscater[6577:3235202] --------------------------\n2015-11-23 13:51:43.478 Unobfuscater[6577:3235202] @rachelmsavage we'd be more than happy to put you in touch with one of our freelance developers. dm me or ross[at]http://content-available-to-author-only.co/3pnlwlwmvo\n2015-11-23 13:51:43.478 Unobfuscater[6577:3235202] --------------------------\n2015-11-23 13:51:43.479 Unobfuscater[6577:3235202] @cgcorcoran hey caroline- we are one of those companies. dm or ping me an email ross(at)http://content-available-to-author-only.co/3pnlwlwmvo if you need pics/quotes\n2015-11-23 13:51:43.479 Unobfuscater[6577:3235202] --------------------------\n2015-11-23 13:51:43.545 Unobfuscater[6577:3235202] MATCHES: 0\n2015-11-23 13:51:43.549 Unobfuscater[6577:3235202] MATCHES: 0\n2015-11-23 13:51:43.552 Unobfuscater[6577:3235202] MATCHES: 0";
  9. NSError *error = nil;
  10. NSString *pattern = @"(?i)[A-Z0-9._%+-]+(\\s*@\\s*|\\[\\[*at\\]\\]|\\s*\\[*\\{*\\(*\\s*]*at\\s*\\]*\\}*\\)*\\s*)[A-Z0-9./:-]+(\\s*[.]\\s*|\\s*\\[*\\{*\\(*\\s*(dot|[.])\\s*\\]*\\}*\\)*\\s*)[a-z]*(\\s*[.]\\s*|/|\\s*\\[*\\{*\\(*\\s*dot\\s*\\]*\\}*\\)*\\s*)?[a-z]*";
  11.  
  12. NSRange range = NSMakeRange(0, string.length);
  13. NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:&error];
  14. NSArray *matches = [regex matchesInString:string options:0 range:range];
  15. for (NSTextCheckingResult *match in matches) {
  16. NSRange matchRange = [match range];
  17. NSString *m = [string substringWithRange:matchRange];
  18. NSLog(@"Matched string: %@", m);
  19. }
  20. return 0;
  21. }
  22. @end
Success #stdin #stdout #stderr 0.04s 42888KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2015-11-23 15:01:57.385 prog[25823] autorelease called without pool for object (0x92494c0) of class NSRegularExpression in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.386 prog[25823] autorelease called without pool for object (0x92a7d78) of class GSMutableArray in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.387 prog[25823] autorelease called without pool for object (0x92a8850) of class GSRegularExpressionCheckingResult in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.389 prog[25823] autorelease called without pool for object (0x92788a0) of class GSRegularExpressionCheckingResult in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.392 prog[25823] autorelease called without pool for object (0x9278a08) of class GSRegularExpressionCheckingResult in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.394 prog[25823] autorelease called without pool for object (0x9264bd8) of class GSCInlineString in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.394 prog[25823] Matched string: ross[at]http://content-available-to-author-only.co/
2015-11-23 15:01:57.394 prog[25823] autorelease called without pool for object (0x92a0188) of class GSCInlineString in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.394 prog[25823] Matched string: ross[at]http://content-available-to-author-only.co/
2015-11-23 15:01:57.394 prog[25823] autorelease called without pool for object (0x9273d48) of class GSCInlineString in thread <NSThread: 0x920b800>
2015-11-23 15:01:57.394 prog[25823] Matched string: ross(at)http://content-available-to-author-only.co/