Home

Awesome

Build Status Build status Coverage Status Coverity Scan Build Status Code Quality: Cpp Total Alerts

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

  1. ./autogen.sh (If configure doesn't exist.)
  2. ./configure
  3. make
  4. make install

Case 2: Windows 64/32bit platform (Visual C++)

Execute build_nmake.cmd. build_x64 or build_x86 will be used as a working/output directory.

  onigmo_s.lib:  static link library
  onigmo.lib:    import library for dynamic link
  onigmo.dll:    dynamic link library

Case 3: Windows 64/32bit platform (MinGW)

Execute mingw32-make -f win32/Makefile.mingw. build_x86-64, build_i686 and etc. will be used as a working/output directory.

  libonigmo.a:     static link library
  libonigmo.dll.a: import library for dynamic link
  onigmo.dll:      dynamic link library

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 UChar type (== unsigned char) definition in onigmo.h, define ONIG_ESCAPE_UCHAR_COLLISION and then include onigmo.h.

If you want to disable regex_t type definition in onigmo.h, define ONIG_ESCAPE_REGEX_T_COLLISION and then include onigmo.h.

Example of the compiling/linking command line in Unix or Cygwin, (prefix == /usr/local case)

cc sample.c -L/usr/local/lib -lonigmo

If you want to use static link library (onigmo_s.lib) in Win32, add option -DONIG_EXTERN=extern to C compiler.

Sample Programs

FileDescription
sample/simple.cexample of the minimum (Onigmo API)
sample/names.cexample of the named group callback.
sample/encode.cexample of some encodings.
sample/listcap.cexample of the capture history.
sample/posix.cPOSIX API sample.
sample/sql.cexample of the variable meta characters.

Test Programs

FileDescription
sample/syntax.cPerl, Java and ASIS syntax test.
sample/crnl.cCRNL test

Source Files

FileDescription
onigmo.hOnigmo API header file (public)
onigmo-config.inconfiguration check program template
onigmo.pyOnigmo module for Python
regenc.hcharacter encodings framework header file
regint.hinternal definitions
regparse.hinternal definitions for regparse.c and regcomp.c
regcomp.ccompiling and optimization functions
regenc.ccharacter encodings framework
regerror.cerror message function
regext.cextended API functions (deluxe version API)
regexec.csearch and match functions
regparse.cparsing functions.
regsyntax.cpattern syntax functions and built-in syntax definition
regtrav.ccapture history tree data traverse functions
regversion.cversion info function
st.hhash table functions header file
st.chash table functions
onigmognu.hGNU regex API header file (public)
reggnu.cGNU regex API functions
onigmoposix.hPOSIX API header file (public)
regposerr.cPOSIX error message function
regposix.cPOSIX API functions
enc/mktable.ccharacter type table generator
enc/ascii.cASCII-8BIT encoding
enc/jis/JIS properties data
enc/euc_jp.cEUC-JP encoding
enc/euc_tw.cEUC-TW encoding
enc/euc_kr.cEUC-KR, EUC-CN encoding
enc/shift_jis.cShift_JIS encoding
enc/shift_jis.hCommon part of Shift_JIS and Windows-31J encoding
enc/windows_31j.cWindows-31J (CP932) encoding
enc/big5.cBig5 encoding
enc/gb18030.cGB18030 encoding
enc/gbk.cGBK encoding
enc/koi8_r.cKOI8-R encoding
enc/koi8_u.cKOI8-U encoding
enc/iso_8859.hcommon definition of ISO-8859 encoding
enc/iso_8859_1.cISO-8859-1 (Latin-1)
enc/iso_8859_2.cISO-8859-2 (Latin-2)
enc/iso_8859_3.cISO-8859-3 (Latin-3)
enc/iso_8859_4.cISO-8859-4 (Latin-4)
enc/iso_8859_5.cISO-8859-5 (Cyrillic)
enc/iso_8859_6.cISO-8859-6 (Arabic)
enc/iso_8859_7.cISO-8859-7 (Greek)
enc/iso_8859_8.cISO-8859-8 (Hebrew)
enc/iso_8859_9.cISO-8859-9 (Latin-5 or Turkish)
enc/iso_8859_10.cISO-8859-10 (Latin-6 or Nordic)
enc/iso_8859_11.cISO-8859-11 (Thai)
enc/iso_8859_13.cISO-8859-13 (Latin-7 or Baltic Rim)
enc/iso_8859_14.cISO-8859-14 (Latin-8 or Celtic)
enc/iso_8859_15.cISO-8859-15 (Latin-9 or West European with Euro)
enc/iso_8859_16.cISO-8859-16 (Latin-10)
enc/utf_8.cUTF-8 encoding
enc/utf_16be.cUTF-16BE encoding
enc/utf_16le.cUTF-16LE encoding
enc/utf_32be.cUTF-32BE encoding
enc/utf_32le.cUTF-32LE encoding
enc/unicode.ccommon codes of Unicode encoding
enc/unicode/Unicode case folding data and properties data
enc/windows_1250.cWindows-1250 (CP1250) encoding (Central/Eastern Europe)
enc/windows_1251.cWindows-1251 (CP1251) encoding (Cyrillic)
enc/windows_1252.cWindows-1252 (CP1252) encoding (Latin)
enc/windows_1253.cWindows-1253 (CP1253) encoding (Greek)
enc/windows_1254.cWindows-1254 (CP1254) encoding (Turkish)
enc/windows_1257.cWindows-1257 (CP1257) encoding (Baltic Rim)
enc/cp949.cCP949 encoding (only used in Ruby)
enc/emacs_mule.cEmacs internal encoding (only used in Ruby)
enc/gb2312.cGB2312 encoding (only used in Ruby)
enc/us_ascii.cUS-ASCII encoding (only used in Ruby)
win32/MakefileMakefile for Win32 (VC++)
win32/Makefile.mingwMakefile for Win32 (MinGW)
win32/config.hconfig.h for Win32
win32/onigmo.rcresource file for Win32