1 [![Build Status](https://travis-ci.org/kkos/oniguruma.svg?branch=master)](https://travis-ci.org/kkos/oniguruma)
6 https://github.com/kkos/oniguruma
8 Oniguruma is a modern and flexible regular expressions library. It
9 encompasses features from different regular expression implementations
10 that traditionally exist in different languages.
12 Character encoding can be specified per regular expression object.
14 Supported character encodings:
16 ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,
17 EUC-JP, EUC-TW, EUC-KR, EUC-CN,
18 Shift_JIS, Big5, GB18030, KOI8-R, CP1251,
19 ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,
20 ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,
21 ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16
23 * GB18030: contributed by KUBO Takehiro
24 * CP1251: contributed by Byte
27 New feature of version 6.9.0
28 --------------------------
30 * NEW: update Unicode version 11.0.0
31 * NEW: add Emoji properties
34 New feature of version 6.8.2
35 --------------------------
37 * Fix: #80 UChar in header causes issue
38 * NEW API: onig_set_callout_user_data_of_match_param() (* omission in 6.8.0)
39 * add doc/CALLOUTS.API and doc/CALLOUTS.API.ja
42 New feature of version 6.8.1
43 --------------------------
45 * Update shared library version to 5.0.0 for API incompatible changes from 6.7.1
48 New feature of version 6.8.0
49 --------------------------
51 * Retry-limit-in-match function enabled by default
52 * NEW: configure option --enable-posix-api=no (* enabled by default)
53 * NEW API: onig_search_with_param(), onig_match_with_param()
54 * NEW: Callouts of contents (?{...contents...}) (?{...}\[tag]\[X<>]) (?{{...}})
55 * NEW: Callouts of name (*name) (*name\[tag]{args...})
56 * NEW: Builtin callouts (*FAIL) (*MISMATCH) (*ERROR{n}) (*COUNT) (*MAX{n}) etc..
57 * Examples of Callouts program: [callout.c](sample/callout.c), [count.c](sample/count.c), [echo.c](sample/echo.c)
60 New feature of version 6.7.1
61 --------------------------
63 * NEW: Mechanism of retry-limit-in-match (* disabled by default)
66 New feature of version 6.7.0
67 --------------------------
69 * NEW: hexadecimal codepoint \uHHHH
70 * NEW: add ONIG_SYNTAX_ONIGURUMA (== ONIG_SYNTAX_DEFAULT)
71 * Disabled \N and \O on ONIG_SYNTAX_RUBY
72 * Reduced size of object file
75 New feature of version 6.6.0
76 --------------------------
78 * NEW: ASCII only mode options for character type/property (?WDSP)
79 * NEW: Extended Grapheme Cluster boundary \y, \Y (*original)
80 * NEW: Extended Grapheme Cluster \X
81 * Range-clear (Absent-clear) operator restores previous range in retractions.
84 New feature of version 6.5.0
85 --------------------------
88 * NEW: \R (general newline) \N (no newline)
89 * NEW: \O (true anychar)
90 * NEW: if-then-else (?(...)...\|...)
91 * NEW: Backreference validity checker (?(xxx)) (*original)
92 * NEW: Absent repeater (?~absent) \[is equal to (?\~\|absent|\O*)]
93 * NEW: Absent expression (?~|absent|expr) (*original)
94 * NEW: Absent stopper (?~|absent) (*original)
97 New feature of version 6.4.0
98 --------------------------
100 * Fix fatal problem of endless repeat on Windows
101 * NEW: call zero (call the total regexp) \g<0>
102 * NEW: relative backref/call by positive number \k<+n>, \g<+n>
105 New feature of version 6.3.0
106 --------------------------
108 * NEW: octal codepoint \o{.....}
109 * Fixed CVE-2017-9224
110 * Fixed CVE-2017-9225
111 * Fixed CVE-2017-9226
112 * Fixed CVE-2017-9227
113 * Fixed CVE-2017-9228
114 * Fixed CVE-2017-9229
117 New feature of version 6.1.2
118 --------------------------
120 * allow word bound, word begin and word end in look-behind.
121 * NEW option: ONIG_OPTION_CHECK_VALIDITY_OF_STRING
123 New feature of version 6.1
124 --------------------------
127 * NEW API: onig_scan()
129 New feature of version 6.0
130 --------------------------
132 * Update Unicode 8.0 Property/Case-folding
133 * NEW API: onig_unicode_define_user_property()
145 ### Case 1: Unix and Cygwin platform
147 1. autoreconf -vfi (* case: configure script is not found.)
157 * configuration check
162 onig-config --exec-prefix
166 ### Case 2: Windows 64/32bit platform (Visual Studio)
170 onig_s.lib: static link library
171 onig.dll: dynamic link library
173 * test (ASCII/Shift_JIS)
176 2. copy ..\windows\testc.c .
177 3. nmake -f Makefile.windows ctest
179 (I have checked by Visual Studio Community 2015)
186 See [doc/RE](doc/RE) or [doc/RE.ja](doc/RE.ja) for Japanese.
192 Include oniguruma.h in your program. (Oniguruma API)
193 See doc/API for Oniguruma API.
195 If you want to disable UChar type (== unsigned char) definition
196 in oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and then
199 If you want to disable regex_t type definition in oniguruma.h,
200 define ONIG_ESCAPE_REGEX_T_COLLISION and then include oniguruma.h.
202 Example of the compiling/linking command line in Unix or Cygwin,
203 (prefix == /usr/local case)
205 cc sample.c -L/usr/local/lib -lonig
208 If you want to use static link library(onig_s.lib) in Win32,
209 add option -DONIG_EXTERN=extern to C compiler.
217 |:---------------------|:-----------------------------------------|
218 |sample/simple.c |example of the minimum (Oniguruma API) |
219 |sample/names.c |example of the named group callback. |
220 |sample/encode.c |example of some encodings. |
221 |sample/listcap.c |example of the capture history. |
222 |sample/posix.c |POSIX API sample. |
223 |sample/scan.c |example of using onig_scan(). |
224 |sample/sql.c |example of the variable meta characters. |
225 |sample/user_property.c|example of user defined Unicode property. |
226 |sample/callout.c |example of callouts. |
232 |:------------------|:--------------------------------------|
233 |sample/syntax.c |Perl, Java and ASIS syntax test. |
234 |sample/crnl.c |--enable-crnl-as-line-terminator test |
242 |:------------------|:-------------------------------------------------------|
243 |oniguruma.h |Oniguruma API header file (public) |
244 |onig-config.in |configuration check program template |
245 |regenc.h |character encodings framework header file |
246 |regint.h |internal definitions |
247 |regparse.h |internal definitions for regparse.c and regcomp.c |
248 |regcomp.c |compiling and optimization functions |
249 |regenc.c |character encodings framework |
250 |regerror.c |error message function |
251 |regext.c |extended API functions (deluxe version API) |
252 |regexec.c |search and match functions |
253 |regparse.c |parsing functions. |
254 |regsyntax.c |pattern syntax functions and built-in syntax definitions|
255 |regtrav.c |capture history tree data traverse functions |
256 |regversion.c |version info function |
257 |st.h |hash table functions header file |
258 |st.c |hash table functions |
259 |oniggnu.h |GNU regex API header file (public) |
260 |reggnu.c |GNU regex API functions |
261 |onigposix.h |POSIX API header file (public) |
262 |regposerr.c |POSIX error message function |
263 |regposix.c |POSIX API functions |
264 |mktable.c |character type table generator |
265 |ascii.c |ASCII encoding |
266 |euc_jp.c |EUC-JP encoding |
267 |euc_tw.c |EUC-TW encoding |
268 |euc_kr.c |EUC-KR, EUC-CN encoding |
269 |sjis.c |Shift_JIS encoding |
270 |big5.c |Big5 encoding |
271 |gb18030.c |GB18030 encoding |
272 |koi8.c |KOI8 encoding |
273 |koi8_r.c |KOI8-R encoding |
274 |cp1251.c |CP1251 encoding |
275 |iso8859_1.c |ISO-8859-1 (Latin-1) |
276 |iso8859_2.c |ISO-8859-2 (Latin-2) |
277 |iso8859_3.c |ISO-8859-3 (Latin-3) |
278 |iso8859_4.c |ISO-8859-4 (Latin-4) |
279 |iso8859_5.c |ISO-8859-5 (Cyrillic) |
280 |iso8859_6.c |ISO-8859-6 (Arabic) |
281 |iso8859_7.c |ISO-8859-7 (Greek) |
282 |iso8859_8.c |ISO-8859-8 (Hebrew) |
283 |iso8859_9.c |ISO-8859-9 (Latin-5 or Turkish) |
284 |iso8859_10.c |ISO-8859-10 (Latin-6 or Nordic) |
285 |iso8859_11.c |ISO-8859-11 (Thai) |
286 |iso8859_13.c |ISO-8859-13 (Latin-7 or Baltic Rim) |
287 |iso8859_14.c |ISO-8859-14 (Latin-8 or Celtic) |
288 |iso8859_15.c |ISO-8859-15 (Latin-9 or West European with Euro) |
289 |iso8859_16.c |ISO-8859-16 (Latin-10) |
290 |utf8.c |UTF-8 encoding |
291 |utf16_be.c |UTF-16BE encoding |
292 |utf16_le.c |UTF-16LE encoding |
293 |utf32_be.c |UTF-32BE encoding |
294 |utf32_le.c |UTF-32LE encoding |
295 |unicode.c |common codes of Unicode encoding |
296 |unicode_fold_data.c|Unicode folding data |
297 |windows/testc.c |Test program for Windowns (VC++) |