What is CocoaOniguruma?

CocoaOniguruma is an Objective-C binding of Oniguruma regular expression engine.

It's simple and tiny compared to the other bindings. It works well on Mac OS X and iPhone.


How to use

CocoaOniguruma is provided as assorted source files primarily.

Follow the steps to use CocoaOniguruma in your project.

  1. Copy "core" directory into your project directory with name "CocoaOniguruma".
  2. Open your project by Xcode.
  3. Add all .h, .c and .m files under "Classes".
  4. Import the header file, so you can use CocoaOniguruma.
    #import "OnigRegexp.h"

How to use as a Framework

You can see "framework" directory next to "core" directory.

  1. Build the project under "framework" directory.
  2. Copy "build/Release/CocoaOniguruma.framework" into your project directory.
  3. Open your project by Xcode.
  4. Add the framework to your project under "Frameworks".
  5. Open "Targets" in the project tree.
  6. Right click on the application target to open context menu and add a "New Copy Files Build Phase".
  7. Drag "CocoaOniguruma.framework" into the new "Copy Files" phase.
  8. Import the header file, so you can use CocoaOniguruma.
    #import "CocoaOniguruma/OnigRegexp.h"


CocoaOniguruma contains a part of Oniguruma 5.9.2 source code currently.
See also the Oniguruma's COPYING file.

The New BSD License
Copyright (c) 2008-2010 Satoshi Nakagawa <>
All rights reserved.


Satoshi Nakagawa