Skip to content

kinwahlai/VerbalExpressionsForObjC

Repository files navigation

VerbalExpressionsForObjC

Ported from VerbalExpressions

VerbalExpressionsForObjC is a Objective C class that helps to construct hard regular expressions.

Example

Testing if we have a valid URL

VerbalExpressions *verex = VerEx()
    .searchOneLine(YES)
    .startOfLine()
    .then( @"http" )
    .maybe( @"s" )
    .then( @"://" )
    .maybe( @"www." )
    .anythingBut( @" " )
    .endOfLine();

XCTAssertTrue([verex test:@"https://mail.google.com"], @"not a valid url");

Replacing strings

NSString *result = VerEx().find(@"google").replace(@"http://www.google.com",@"yahoo");
    
XCTAssertTrue([result isEqualToString:@"http://www.yahoo.com"], @"cannot find the text to replace");

Other Implementations

You can see an up to date list of all ports in our organization.

About

Ported from VerbalExpressions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published