Objective-C Library For Easily Creating Regular Expression Like Queries (Verbal Expressions)

I’ve mentioned regular expressions a few times, most recently with this free tool for building regular expressions easily that works great for the creation of valid regular expressions to use with NSRegularExpression.

Here’s a handy library called VRXVerbalExpressions that allows you to create regular expression style queries with a verbal syntax.

VRXVerbalExpressions is an Objective-C port of the Verbal Expressions library, and here’s an example from the tests in the source code showing how one could check for a valid url:

id exp = [VRXVerbalExpression create:^(VRXVerbalExpression *r) {
[r startOfLine];
[r then:@"http"];
[r maybe:@"s"];
[r then:@"://"];
[r maybe:@"www."];
[r anythingBut:@" "];
[r endOfLine];
}];

You can find VRXVerbalExpressions on Github here.

Perfect for those of us who don’t use regular expressions all the time.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Objective-C Library For Easily Creating Regular Expression Like Queries (Verbal Expressions)

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *