| 1 |
README 2018/04/05 |
| 2 |
|
| 3 |
Oniguruma ---- (C) K.Kosako |
| 4 |
|
| 5 |
https://github.com/kkos/oniguruma |
| 6 |
|
| 7 |
FIXED Security Issues (in Oniguruma 6.3.0): |
| 8 |
CVE-2017-9224, CVE-2017-9225, CVE-2017-9226 |
| 9 |
CVE-2017-9227, CVE-2017-9228, CVE-2017-9229 |
| 10 |
|
| 11 |
--- |
| 12 |
Oniguruma is a modern and flexible regular expressions library. It |
| 13 |
encompasses features from different regular expression implementations |
| 14 |
that traditionally exist in different languages. It comes close to |
| 15 |
being a complete superset of all regular expression features found |
| 16 |
in other regular expression implementations. |
| 17 |
|
| 18 |
Its features include: |
| 19 |
* Character encoding can be specified per regular expression object. |
| 20 |
* Several regular expression types are supported: |
| 21 |
* POSIX |
| 22 |
* Grep |
| 23 |
* GNU Regex |
| 24 |
* Perl |
| 25 |
* Java |
| 26 |
* Ruby |
| 27 |
* Emacs |
| 28 |
|
| 29 |
Supported character encodings: |
| 30 |
|
| 31 |
ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, |
| 32 |
EUC-JP, EUC-TW, EUC-KR, EUC-CN, |
| 33 |
Shift_JIS, Big5, GB18030, KOI8-R, CP1251, |
| 34 |
ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, |
| 35 |
ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, |
| 36 |
ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16 |
| 37 |
|
| 38 |
* GB18030: contributed by KUBO Takehiro |
| 39 |
* CP1251: contributed by Byte |
| 40 |
------------------------------------------------------------ |
| 41 |
|
| 42 |
License |
| 43 |
|
| 44 |
BSD license. |
| 45 |
|
| 46 |
|
| 47 |
Install |
| 48 |
|
| 49 |
Case 1: Linux distribution packages |
| 50 |
|
| 51 |
* Fedora: dnf install oniguruma-devel |
| 52 |
* RHEL/CentOS: yum install oniguruma |
| 53 |
* Debian/Ubuntu: apt install libonig5 |
| 54 |
* Arch: pacman -S oniguruma |
| 55 |
* openSUSE: zypper install oniguruma |
| 56 |
|
| 57 |
Case 2: Manual compilation on Linux, Unix, and Cygwin platform |
| 58 |
|
| 59 |
1. autoreconf -vfi (* case: configure script is not found.) |
| 60 |
|
| 61 |
2. ./configure |
| 62 |
3. make |
| 63 |
4. make install |
| 64 |
|
| 65 |
* uninstall |
| 66 |
|
| 67 |
make uninstall |
| 68 |
|
| 69 |
* configuration check |
| 70 |
|
| 71 |
onig-config --cflags |
| 72 |
onig-config --libs |
| 73 |
onig-config --prefix |
| 74 |
onig-config --exec-prefix |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
Case 3: Windows 64/32bit platform (Visual Studio) |
| 79 |
|
| 80 |
execute make_win64 or make_win32 |
| 81 |
|
| 82 |
src/onig_s.lib: static link library |
| 83 |
src/onig.dll: dynamic link library |
| 84 |
|
| 85 |
* test (ASCII/Shift_JIS) |
| 86 |
1. cd src |
| 87 |
2. copy ..\windows\testc.c . |
| 88 |
3. nmake -f Makefile.windows ctest |
| 89 |
|
| 90 |
(I have checked by Visual Studio Community 2015) |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
Regular Expressions |
| 95 |
|
| 96 |
See doc/RE (or doc/RE.ja for Japanese). |
| 97 |
|
| 98 |
|
| 99 |
Usage |
| 100 |
|
| 101 |
Include oniguruma.h in your program. (Oniguruma API) |
| 102 |
See doc/API for Oniguruma API. |
| 103 |
|
| 104 |
If you want to disable UChar type (== unsigned char) definition |
| 105 |
in oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and then |
| 106 |
include oniguruma.h. |
| 107 |
|
| 108 |
If you want to disable regex_t type definition in oniguruma.h, |
| 109 |
define ONIG_ESCAPE_REGEX_T_COLLISION and then include oniguruma.h. |
| 110 |
|
| 111 |
Example of the compiling/linking command line in Unix or Cygwin, |
| 112 |
(prefix == /usr/local case) |
| 113 |
|
| 114 |
cc sample.c -L/usr/local/lib -lonig |
| 115 |
|
| 116 |
|
| 117 |
If you want to use static link library(onig_s.lib) in Win32, |
| 118 |
add option -DONIG_EXTERN=extern to C compiler. |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
Sample Programs |
| 123 |
|
| 124 |
sample/simple.c example of the minimum (Oniguruma API) |
| 125 |
sample/names.c example of the named group callback. |
| 126 |
sample/encode.c example of some encodings. |
| 127 |
sample/listcap.c example of the capture history. |
| 128 |
sample/posix.c POSIX API sample. |
| 129 |
sample/sql.c example of the variable meta characters. |
| 130 |
(SQL-like pattern matching) |
| 131 |
sample/user_property.c example of user defined Unicode property. |
| 132 |
|
| 133 |
Test Programs |
| 134 |
sample/syntax.c Perl, Java and ASIS syntax test. |
| 135 |
sample/crnl.c --enable-crnl-as-line-terminator test |
| 136 |
|
| 137 |
|
| 138 |
Source Files |
| 139 |
|
| 140 |
oniguruma.h Oniguruma API header file. (public) |
| 141 |
onig-config.in configuration check program template. |
| 142 |
|
| 143 |
regenc.h character encodings framework header file. |
| 144 |
regint.h internal definitions |
| 145 |
regparse.h internal definitions for regparse.c and regcomp.c |
| 146 |
regcomp.c compiling and optimization functions |
| 147 |
regenc.c character encodings framework. |
| 148 |
regerror.c error message function |
| 149 |
regext.c extended API functions. (deluxe version API) |
| 150 |
regexec.c search and match functions |
| 151 |
regparse.c parsing functions. |
| 152 |
regsyntax.c pattern syntax functions and built-in syntax definitions. |
| 153 |
regtrav.c capture history tree data traverse functions. |
| 154 |
regversion.c version info function. |
| 155 |
st.h hash table functions header file |
| 156 |
st.c hash table functions |
| 157 |
|
| 158 |
oniggnu.h GNU regex API header file. (public) |
| 159 |
reggnu.c GNU regex API functions |
| 160 |
|
| 161 |
onigposix.h POSIX API header file. (public) |
| 162 |
regposerr.c POSIX error message function. |
| 163 |
regposix.c POSIX API functions. |
| 164 |
|
| 165 |
mktable.c character type table generator. |
| 166 |
ascii.c ASCII encoding. |
| 167 |
euc_jp.c EUC-JP encoding. |
| 168 |
euc_tw.c EUC-TW encoding. |
| 169 |
euc_kr.c EUC-KR, EUC-CN encoding. |
| 170 |
sjis.c Shift_JIS encoding. |
| 171 |
big5.c Big5 encoding. |
| 172 |
gb18030.c GB18030 encoding. |
| 173 |
koi8.c KOI8 encoding. |
| 174 |
koi8_r.c KOI8-R encoding. |
| 175 |
cp1251.c CP1251 encoding. |
| 176 |
iso8859_1.c ISO-8859-1 encoding. (Latin-1) |
| 177 |
iso8859_2.c ISO-8859-2 encoding. (Latin-2) |
| 178 |
iso8859_3.c ISO-8859-3 encoding. (Latin-3) |
| 179 |
iso8859_4.c ISO-8859-4 encoding. (Latin-4) |
| 180 |
iso8859_5.c ISO-8859-5 encoding. (Cyrillic) |
| 181 |
iso8859_6.c ISO-8859-6 encoding. (Arabic) |
| 182 |
iso8859_7.c ISO-8859-7 encoding. (Greek) |
| 183 |
iso8859_8.c ISO-8859-8 encoding. (Hebrew) |
| 184 |
iso8859_9.c ISO-8859-9 encoding. (Latin-5 or Turkish) |
| 185 |
iso8859_10.c ISO-8859-10 encoding. (Latin-6 or Nordic) |
| 186 |
iso8859_11.c ISO-8859-11 encoding. (Thai) |
| 187 |
iso8859_13.c ISO-8859-13 encoding. (Latin-7 or Baltic Rim) |
| 188 |
iso8859_14.c ISO-8859-14 encoding. (Latin-8 or Celtic) |
| 189 |
iso8859_15.c ISO-8859-15 encoding. (Latin-9 or West European with Euro) |
| 190 |
iso8859_16.c ISO-8859-16 encoding. |
| 191 |
(Latin-10 or South-Eastern European with Euro) |
| 192 |
utf8.c UTF-8 encoding. |
| 193 |
utf16_be.c UTF-16BE encoding. |
| 194 |
utf16_le.c UTF-16LE encoding. |
| 195 |
utf32_be.c UTF-32BE encoding. |
| 196 |
utf32_le.c UTF-32LE encoding. |
| 197 |
unicode.c common codes of Unicode encoding. |
| 198 |
|
| 199 |
win32/Makefile Makefile for Win32 (VC++) |
| 200 |
win32/config.h config.h for Win32 |
| 201 |
|
| 202 |
|
| 203 |
and I'm thankful to Akinori MUSHA. |