Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgn/cocoaverbalexpression
https://github.com/kgn/cocoaverbalexpression
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/kgn/cocoaverbalexpression
- Owner: kgn
- Created: 2013-08-05T19:07:19.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-05T19:17:29.000Z (over 11 years ago)
- Last Synced: 2023-10-20T20:58:21.576Z (about 1 year ago)
- Language: Objective-C
- Size: 105 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Cocoa port of [VerbalExpressions](https://github.com/jehna/VerbalExpressions). Still very much in development, contributions welcome!
``` obj-c
VerbalExpression *verbalExpression = [VerbalExpression expression];
[verbalExpression whiteSpace];
[verbalExpression then:@"#"];
[verbalExpression somethingBut:[VerbalExpression number]];
[verbalExpression anyOf:[VerbalExpression word], [VerbalExpression number], @"-", @"_", nil];NSError *error = nil;
NSRegularExpression *regex =
[NSRegularExpression regularExpressionWithPattern:verbalExpression.pattern options:NSRegularExpressionCaseInsensitive error:&error];
NSArray *matches = [regex matchesInString:text options:0 range:NSMakeRange(0, text.length)];
for(NSTextCheckingResult *match in matches){
...
}
```