Skip to content

Commit

Permalink
Renamed - (NSString *)stringWithRegexPattern:(NSString*)pattern subst…
Browse files Browse the repository at this point in the history
…itute:(NSString*)substitute to (NSString *)stringByRegex:(NSString*)pattern substitution:(NSString*)substitute;
  • Loading branch information
artifacts committed Sep 26, 2008
1 parent 47e313c commit f71f83c
Show file tree
Hide file tree
Showing 5 changed files with 555 additions and 115 deletions.
2 changes: 1 addition & 1 deletion Classes/AFRegexString.h
Expand Up @@ -31,7 +31,7 @@

@interface NSString (AFRegex)

- (NSString *)stringWithRegexPattern:(NSString*)pattern substitute:(NSString*)substitute;
- (NSString *)stringByRegex:(NSString*)pattern substitution:(NSString*)substitute;
- (BOOL)matchesPattern:(NSString*)pattern;
- (BOOL)matchesPattern:(NSString*)pattern options:(int)options;

Expand Down
2 changes: 1 addition & 1 deletion Classes/AFRegexString.m
Expand Up @@ -67,7 +67,7 @@ int rreplace (char *buf, int size, regex_t *re, char *rp)

@implementation NSString (AFRegex)

- (NSString *)stringWithRegexPattern:(NSString*)pattern substitute:(NSString*)substitute
- (NSString *)stringByRegex:(NSString*)pattern substitution:(NSString*)substitute
{
regex_t preg;

Expand Down
4 changes: 2 additions & 2 deletions Classes/RegexViewController.m
Expand Up @@ -33,13 +33,13 @@ @implementation RegexViewController

- (void)viewWillAppear:(BOOL)animated
{
self.output.text = [self.input.text stringWithRegexPattern:self.pattern.text substitute:self.substitute.text];
self.output.text = [self.input.text stringByRegex:self.pattern.text substitution:self.substitute.text];
}

- (void)textFieldDidEndEditing:(UITextField *)textField
{
@try {
self.output.text = [self.input.text stringWithRegexPattern:self.pattern.text substitute:self.substitute.text];
self.output.text = [self.input.text stringByRegex:self.pattern.text substitution:self.substitute.text];
}
@catch (NSException *exception)
{
Expand Down

0 comments on commit f71f83c

Please sign in to comment.