kinwahlai / VerbalExpressionsForObjC

Ported from VerbalExpressions

Home Page:https://github.com/jehna/VerbalExpressions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

https://github.com/jehna/VerbalExpressions


Languages

Language:Objective-C 100.0%