https://github.com/jangorman/jgoregexpbuilder
A delightful regular expressions DSL
https://github.com/jangorman/jgoregexpbuilder
dsl ios objective-c regex regular-expression
Last synced: about 1 year ago
JSON representation
A delightful regular expressions DSL
- Host: GitHub
- URL: https://github.com/jangorman/jgoregexpbuilder
- Owner: JanGorman
- License: mit
- Created: 2014-03-16T17:07:13.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-01-20T17:45:49.000Z (over 10 years ago)
- Last Synced: 2024-09-19T14:32:13.309Z (over 1 year ago)
- Topics: dsl, ios, objective-c, regex, regular-expression
- Language: Objective-C
- Homepage:
- Size: 157 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# JGORegExpBuilder
[](https://travis-ci.org/JanGorman/JGORegExpBuilder)
## Usage
You can use the builder in your project like this:
```objc
JGORegExpBuilder *builder = RegExpBuilder().exactly(1).of(@"p");
builder.test(@"p"); // YES
builder.test(@"q"); // NO
// If you want to access the underlying NSRegularExpression
NSRegularExpression *regularExpression = builder.regularExpression;
```
For simple matches use the builder directly. If you want to do more, simply access the `NSRegularExpression`, e.g. to search and replace inside a string.
See the `JGORegExpBuilderTests.m` file for some more examples of what you can do
## Installation
JGORegExpBuilder is available through [CocoaPods](http://cocoapods.org), to install
it simply add the following line to your Podfile:
`pod "JGORegExpBuilder"`
## Inspiration
Based on the JavaScript builder by [thebinarysearchtree](https://github.com/thebinarysearchtree/regexpbuilderjs/wiki).
## License
JGORegExpBuilder is available under the MIT license. See the LICENSE file for more info.