Home

Awesome

Fuzzing Status

Oniguruma

The only open source software attacked on Google search in Japan. (Issue #234)

https://github.com/kkos/oniguruma

Oniguruma is a modern and flexible regular expressions library. It encompasses features from different regular expression implementations that traditionally exist in different languages.

Character encoding can be specified per regular expression object.

Supported character encodings:

ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, EUC-JP, EUC-TW, EUC-KR, EUC-CN, Shift_JIS, Big5, GB18030, KOI8-R, CP1251, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16

Notice (from 6.9.6)

When using configure script, if you have the POSIX API enabled in an earlier version (disabled by default in 6.9.5) and you need application binary compatibility with the POSIX API, specify "--enable-binary-compatible-posix-api=yes" instead of "--enable-posix-api=yes". Starting in 6.9.6, "--enable-posix-api=yes" only supports source-level compatibility for 6.9.5 and earlier about POSIX API. (Issue #210)

Version 6.9.10

Version 6.9.9

Version 6.9.8

Version 6.9.7

Version 6.9.6

License

BSD license.

Install

Case 1: Linux distribution packages

Case 2: Manual compilation on Linux, Unix, and Cygwin platform

  1. autoreconf -vfi (* case: configure script is not found.)

  2. ./configure

  3. make

  4. make install

Case 3: Windows 64/32bit platform (Visual Studio)

Alternatively, you can build and install oniguruma using vcpkg dependency manager:

  1. git clone https://github.com/Microsoft/vcpkg.git
  2. cd vcpkg
  3. ./bootstrap-vcpkg.bat
  4. ./vcpkg integrate install
  5. ./vcpkg install oniguruma

The oniguruma port in vcpkg is kept up to date by microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Regular Expressions

See doc/RE or doc/RE.ja for Japanese.

Usage

Include oniguruma.h in your program. (Oniguruma API) See doc/API for Oniguruma API.

If you want to disable UChar type (== unsigned char) definition in oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and then include oniguruma.h.

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

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

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

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

Sample Programs

FileDescription
sample/callout.cexample of callouts
sample/count.cexample of built-in callout *COUNT
sample/echo.cexample of user defined callouts of name
sample/encode.cexample of some encodings
sample/listcap.cexample of the capture history
sample/names.cexample of the named group callback
sample/posix.cPOSIX API sample
sample/regset.cexample of using RegSet API
sample/scan.cexample of using onig_scan()
sample/simple.cexample of the minimum (Oniguruma API)
sample/sql.cexample of the variable meta characters
sample/user_property.cexample of user defined Unicode property

Test Programs

FileDescription
sample/syntax.cPerl, Java and ASIS syntax test.
sample/crnl.c--enable-crnl-as-line-terminator test

Source Files

FileDescription
oniguruma.hOniguruma API header file (public)
onig-config.inconfiguration check program template
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 definitions
regtrav.ccapture history tree data traverse functions
regversion.cversion info function
st.hhash table functions header file
st.chash table functions
oniggnu.hGNU regex API header file (public)
reggnu.cGNU regex API functions
onigposix.hPOSIX API header file (public)
regposerr.cPOSIX error message function
regposix.cPOSIX API functions
mktable.ccharacter type table generator
ascii.cASCII encoding
euc_jp.cEUC-JP encoding
euc_tw.cEUC-TW encoding
euc_kr.cEUC-KR, EUC-CN encoding
sjis.cShift_JIS encoding
big5.cBig5 encoding
gb18030.cGB18030 encoding
koi8.cKOI8 encoding
koi8_r.cKOI8-R encoding
cp1251.cCP1251 encoding
iso8859_1.cISO-8859-1 (Latin-1)
iso8859_2.cISO-8859-2 (Latin-2)
iso8859_3.cISO-8859-3 (Latin-3)
iso8859_4.cISO-8859-4 (Latin-4)
iso8859_5.cISO-8859-5 (Cyrillic)
iso8859_6.cISO-8859-6 (Arabic)
iso8859_7.cISO-8859-7 (Greek)
iso8859_8.cISO-8859-8 (Hebrew)
iso8859_9.cISO-8859-9 (Latin-5 or Turkish)
iso8859_10.cISO-8859-10 (Latin-6 or Nordic)
iso8859_11.cISO-8859-11 (Thai)
iso8859_13.cISO-8859-13 (Latin-7 or Baltic Rim)
iso8859_14.cISO-8859-14 (Latin-8 or Celtic)
iso8859_15.cISO-8859-15 (Latin-9 or West European with Euro)
iso8859_16.cISO-8859-16 (Latin-10)
utf8.cUTF-8 encoding
utf16_be.cUTF-16BE encoding
utf16_le.cUTF-16LE encoding
utf32_be.cUTF-32BE encoding
utf32_le.cUTF-32LE encoding
unicode.ccommon codes of Unicode encoding
unicode_fold_data.cUnicode folding data
windows/testc.cTest program for Windows (VC++)