Skip to content

Commit

Permalink
Add OnigRegexp-captureCount method
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Sobo authored and psychs committed Aug 7, 2012
1 parent 5a002e7 commit f4534a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/core/OnigRegexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ typedef enum {
- (OnigResult*)match:(NSString*)target;
- (OnigResult*)match:(NSString*)target start:(int)start;

- (NSUInteger)captureCount;
- (NSString*)expression;

@end
Expand Down
5 changes: 5 additions & 0 deletions framework/core/OnigRegexp.m
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ - (OnigResult*)match:(NSString*)target start:(int)start
}
}

- (NSUInteger)captureCount
{
return onig_number_of_captures(_entity);
}

- (NSString*)expression
{
return _expression;
Expand Down

0 comments on commit f4534a2

Please sign in to comment.