VerbalExpressions 0.1.0

VerbalExpressions 0.1.0

LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.

  • By
  • sakiwei

VerbalExpressions Objective C Library

VerbalExpressions is an Objective C library that helps to construct difficult regular expressions.


VerbalExpressions requires either iOS >= 4.3, or Mac OS >= 10.7. Also, it uses ARC.


From source

Drags VerbalExpressions.h and VerbalExpressions.m into your projects and import "VerbalExpressions.h"


// url matches
VerbalExpressions *tester = [[[[[[[[VerEX() startOfLine] then:@"http"] maybe:@"s"] then:@"://"] maybe:@"www."] anythingBut:@" "] range:@[@"a",@"e"]] endOfLine];

NSString *testMe = @"";
if( [tester test:testMe] ){
    NSLog(@"We have a correct URL ");
    NSLog(@"The URL is incorrect");

// replace string
NSString *replaceMe = @"Replace bird with a duck";
tester = [VerEX() find:@"bird"];
NSString *result = [tester replace:replaceMe by:@"duck"];
NSLog(@"result = %@",result);

// shorthand for string replace
result = [[VerEX() find:@"red"] replace:@"We have a red house" by:@"blue"];
NSLog(@"result = %@",result);