Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ruby :

"The limits of my language define the limits of my world" if string =~ /foobar(\d\w)/#

Objective-C :

  NSError *error = NULL;
  NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"foobar(\\d*\\w)"
  options:NSRegularExpressionCaseInsensitive error:&error];
  NSTextCheckingResult *match = [regex firstMatchInString:string
                                                options:0
                                                   range:NSMakeRange(0, [string length])];
  if (match) {
    NSLog(@"The limits of my language define the limits of my world - Wittgenstein")
  }
Enough said?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: