Onigmo is a regular expressions library forked from Oniguruma.
It focuses to support new expressions like \K, \R, (?(cond)yes|no)
and etc. which are supported in Perl 5.10+.
Since Onigmo is used as the default regexp library of Ruby 2.0 or later,
many patches are backported from Ruby 2.x.
Onigmo (Oniguruma-mod)
https://github.com/k-takata/Onigmo
Onigmo is a regular expressions library forked from Oniguruma. It focuses to support new expressions like
\K,\R,(?(cond)yes|no)and etc. which are supported in Perl 5.10+.Since Onigmo is used as the default regexp library of Ruby 2.0 or later, many patches are backported from Ruby 2.x.
See also the Wiki page: https://github.com/k-takata/Onigmo/wiki
License
BSD license.
Install
Case 1: Unix and Cygwin platform
./autogen.sh(Ifconfiguredoesn’t exist.)./configuremakemake installtest
make test
uninstall
make uninstall
configuration check
onigmo-config –cflags onigmo-config –libs onigmo-config –prefix onigmo-config –exec-prefix
Case 2: Windows 64/32bit platform (Visual C++)
Execute
build_nmake.cmd.build_x64orbuild_x86will be used as a working/output directory.test (ASCII/Shift_JIS/EUC-JP/Unicode)
Execute
build_nmake.cmd test. Python (with the same bitness of Onigmo) is needed to run the tests.Case 3: Windows 64/32bit platform (MinGW)
Execute
mingw32-make -f win32/Makefile.mingw.build_x86-64,build_i686and etc. will be used as a working/output directory.test (ASCII/Shift_JIS/EUC-JP/Unicode)
Execute
mingw32-make -f win32/Makefile.mingw test. Python (with the same bitness of Onigmo) is needed to run the tests.If you use MinGW on MSYS2, you can also use
./configureandmakelike Unix. In this case, DLL name will have API version number. E.g.:libonigmo-6.dll
Regular Expressions
See doc/RE or doc/RE.ja for Japanese.
Usage
Include onigmo.h in your program. (Onigmo API) See doc/API for Onigmo API.
If you want to disable
UChartype (==unsigned char) definition in onigmo.h, defineONIG_ESCAPE_UCHAR_COLLISIONand then include onigmo.h.If you want to disable
regex_ttype definition in onigmo.h, defineONIG_ESCAPE_REGEX_T_COLLISIONand then include onigmo.h.Example of the compiling/linking command line in Unix or Cygwin, (prefix == /usr/local case)
If you want to use static link library (onigmo_s.lib) in Win32, add option
-DONIG_EXTERN=externto C compiler.Sample Programs
Test Programs
Source Files