• Stars
    star
    135
  • Rank 268,097 (Top 6 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 11 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Objective-C implementation of Verbal Expressions

VRXVerbalExpressions

An Objective-C implementation of VerbalExpressions

Installation

For now, just add VRXVerbalExpressions.h and VRXVerbalExpressions.m files to your project.

(CocoaPods coming soon)

Examples

Testing if we have a valid URL

//
// There are two ways of creating VRXExpressions. Either through
// a block based API:
//
id exp = [VRXVerbalExpression create:^(VRXVerbalExpression *r) {
        [r startOfLine];
        [r then:@"http"];
        [r maybe:@"s"];
        [r then:@"://"];
        [r maybe:@"www."];
        [r anythingBut:@" "];
        [r endOfLine];
}];

// 
// or a messages based API can be used:
// Note that startOfLine is both an instance and class method, 
// facilitating both methods of creating expressions
//
id exp = [[[[[[[VRXVerbalExpression startOfLine]
                   then:@"http"]
                  maybe:@"s"]
                 then:@"://"]
                maybe:@"www."]
               anythingBut:@" "]
              endOfLine];

//
// Once a VRXVerbalExpression has been created (id was used
// above for brevity), it can be tested for matches:
//
BOOL test = [exp test:@"https://www.google.com"];

Developer setup : running the tests

The tests use NSUnit, there is a Podfile included that will setup NSUnit for you. Just run Pod install in the VRXVerbalExpressions directory.

More Repositories

1

manos

Manos is an easy to use, easy to test, high performance web application framework that stays out of your way and makes your life ridiculously simple.
C#
455
star
2

OcticonsIOS

A library for easily adding GitHub's Octions to your iOS projects
Objective-C
51
star
3

MCloud

A .NET client library for managing cloud providers. (Based on libcloud)
C#
23
star
4

NSUnit

Objective-C Unit testing framework
Objective-C
20
star
5

sox

Personal fork of Sox - Sound eXchange, from http://sox.sourceforge.net/
C
20
star
6

gitmarks

Add project bookmarking to github
JavaScript
17
star
7

oxen

Observable collections in Objective-C
Objective-C
12
star
8

http-parser.cs

Port of the http-parser library written in C#
C#
8
star
9

RSCPRunscopeManager

One weird trick to convert all your URLs to Runscope URLs
Objective-C
7
star
10

getbin

Utility for downloading pastebin files
3
star
11

manos-spark

Library for using the Spark View Engine with Manos de Mono applications
C#
3
star
12

Manos.Mustache

Add Mustache templates to your Manos projects
C#
3
star
13

Should-C

Should unit testing functions for Objective-C
Objective-C
2
star
14

Froxy

A copy of hurl.it that runs on Manos de Mono
JavaScript
2
star
15

octophile

Basic app for displaying GitHub user info using OctoKit
Objective-C
2
star
16

mirth

Java
2
star
17

node-oauth2-provider-redis

Redis backend for node-oauth2-provider
JavaScript
2
star
18

crvlib

Open source bits and pieces from codereview.io
Objective-C
1
star
19

UploadTests

C#
1
star
20

ccf

Continuous Customer Feedback
Python
1
star
21

twilio-client-token-js

Create twilio client tokens in javascript
1
star