CocoaOniguruma
CocoaOniguruma is an Objective-C binding of Oniguruma regular expression engine.
It's simple and tiny compared to the other bindings.
Download
git clone git://github.com/psychs/cocoaoniguruma.git
How to use
CocoaOniguruma is designed as a static link library not a framework.
Follow the steps to use CocoaOniguruma in your project.
- Copy "core" directory into your project directory with name "CocoaOniguruma". (Assume your project name is "YourProject" here.)
- Open your project by Xcode.
- Add all .h and .m files under "Classes".
- Right click on "Classes" and select [Add] -> [Existing Files...].
- Select the following files and push the OK button.
- OnigRegexp.h
- OnigRegexp.m
- OnigRegexpUtility.h
- OnigRegexpUtility.m
- Add an external target under Targets.
- Right click on Targets and select [Add] -> [New Target...].
- In the Assistant dialog, select "External Target" under "Special Targets".
- Input "CocoaOniguruma" for "Target Name".
- Double click on the CocoaOniguruma target under "Targets".
- In the dialog, input "CocoaOniguruma/oniguruma" for "Directory" under "Custom Build Command".
- Add the external target to the build process.
- Drag the CocoaOniguruma target item into "YourProject" item under "Targets". Then you can see the CocoaOniguruma target item under "YourProject".
- Build the project. (This takes for a while. Then you will see some link errors, but it's no problem. Go ahead.)
- Add libonig.a to "Linked Frameworks".
- Expand "Frameworks" item.
- Right click on "Linked Frameworks" and select [Add] -> [Existing Files...].
- Select "CocoaOniguruma/oniguruma/universal/libonig.a".
- Import the header file, so you can use CocoaOniguruma.
#import "CocoaOniguruma/OnigRegexp.h"
The Author
- Satoshi Nakagawa <artension AT gmail DOT com>
- http://d.hatena.ne.jp/Psychs/ (in Japanese)
- #LimeChat on irc.freenode.net
License
The revised BSD license.
See also the Oniguruma's COPYING file.
