]> granicus.if.org Git - onig/blob - README.md
reduce CHECK_TRY_IN_MATCH_LIMIT points
[onig] / README.md
1 Oniguruma
2 =========
3
4 https://github.com/kkos/oniguruma
5
6 FIXED Security Issues:
7 --------------------------
8   **CVE-2017-9224, CVE-2017-9225, CVE-2017-9226**
9   **CVE-2017-9227, CVE-2017-9228, CVE-2017-9229**
10
11 Oniguruma is a modern and flexible regular expressions library. It
12 encompasses features from different regular expression implementations
13 that traditionally exist in different languages. It comes close to
14 being a complete superset of all regular expression features found
15 in other regular expression implementations.
16
17 Its features include:
18 * Character encoding can be specified per regular expression object.
19 * Several regular expression types are supported:
20   * POSIX
21   * Grep
22   * GNU Regex
23   * Perl
24   * Java
25   * Ruby
26   * Emacs
27
28 Supported character encodings:
29
30   ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,
31   EUC-JP, EUC-TW, EUC-KR, EUC-CN,
32   Shift_JIS, Big5, GB18030, KOI8-R, CP1251,
33   ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,
34   ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,
35   ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16
36
37 * GB18030: contributed by KUBO Takehiro
38 * CP1251:  contributed by Byte
39
40
41 New feature of version 6.7.1
42 --------------------------
43
44 * NEW: Mechanism of try-in-match-limit (* disabled by default)
45
46
47 New feature of version 6.7.0
48 --------------------------
49
50 * NEW: hexadecimal codepoint \uHHHH
51 * NEW: add ONIG_SYNTAX_ONIGURUMA (== ONIG_SYNTAX_DEFAULT)
52 * Disabled \N and \O on ONIG_SYNTAX_RUBY
53 * Reduced object size
54
55
56 New feature of version 6.6.1
57 --------------------------
58
59 * Fix definition of \X
60
61
62 New feature of version 6.6.0
63 --------------------------
64
65 * NEW: ASCII only mode options for character type/property (?WDSP)
66 * NEW: Extended Grapheme Cluster boundary \y, \Y (*original)
67 * NEW: Extended Grapheme Cluster \X
68 * Range-clear (Absent-clear) operator restores previous range in backtrack.
69
70
71 New feature of version 6.5.0
72 --------------------------
73
74 * NEW: \K (keep)
75 * NEW: \R (general newline) \N (no newline)
76 * NEW: \O (true anychar)
77 * NEW: if-then-else syntax   (?(...)...\|...)
78 * NEW: Backreference validity checker (?(xxx)) (*original)
79 * NEW: Absent repeater (?~absent)
80 * NEW: Absent expression   (?~|absent|expr)  (*original)
81 * NEW: Absent stopper (?~|absent)     (*original)
82
83
84 New feature of version 6.4.0
85 --------------------------
86
87 * Fix fatal problem of endless repeat on Windows
88 * NEW: call zero (call the total regexp) \g<0>
89 * NEW: relative backref/call by positive number \k<+n>, \g<+n>
90
91
92 New feature of version 6.3.0
93 --------------------------
94
95 * NEW: octal codepoint \o{.....}
96
97
98 New feature of version 6.1.2
99 --------------------------
100
101 * allow word bound, word begin and word end in look-behind.
102 * NEW option: ONIG_OPTION_CHECK_VALIDITY_OF_STRING
103
104 New feature of version 6.1
105 --------------------------
106
107 * improved doc/RE
108 * NEW API: onig_scan()
109
110 New feature of version 6.0
111 --------------------------
112
113 * Update Unicode 8.0 Property/Case-folding
114 * NEW API: onig_unicode_define_user_property()
115
116
117 License
118 -------
119
120   BSD license.
121
122
123 Install
124 -------
125
126 ### Case 1: Unix and Cygwin platform
127
128    1. autoreconf -vfi   (* case: configure script is not found.)
129
130    2. ./configure
131    3. make
132    4. make install
133
134    * uninstall
135
136      make uninstall
137
138    * configuration check
139
140      onig-config --cflags
141      onig-config --libs
142      onig-config --prefix
143      onig-config --exec-prefix
144
145
146
147 ### Case 2: Windows 64/32bit platform (Visual Studio)
148
149    execute make_win64 or make_win32
150
151       onig_s.lib:  static link library
152       onig.dll:    dynamic link library
153
154    * test (ASCII/Shift_JIS)
155
156       1. cd src
157       2. copy ..\windows\testc.c .
158       3. nmake -f Makefile.windows ctest
159
160    (I have checked by Visual Studio Community 2015)
161
162
163
164 Regular Expressions
165 -------------------
166
167   See [doc/RE](doc/RE) or [doc/RE.ja](doc/RE.ja) for Japanese.
168
169
170 Usage
171 -----
172
173   Include oniguruma.h in your program. (Oniguruma API)
174   See doc/API for Oniguruma API.
175
176   If you want to disable UChar type (== unsigned char) definition
177   in oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and then 
178   include oniguruma.h.
179
180   If you want to disable regex_t type definition in oniguruma.h,
181   define ONIG_ESCAPE_REGEX_T_COLLISION and then include oniguruma.h.
182
183   Example of the compiling/linking command line in Unix or Cygwin,
184   (prefix == /usr/local case)
185
186     cc sample.c -L/usr/local/lib -lonig
187
188
189   If you want to use static link library(onig_s.lib) in Win32,
190   add option -DONIG_EXTERN=extern to C compiler.
191
192
193
194 Sample Programs
195 ---------------
196
197 |File                  |Description                               |
198 |:---------------------|:-----------------------------------------|
199 |sample/simple.c       |example of the minimum (Oniguruma API)    |
200 |sample/names.c        |example of the named group callback.      |
201 |sample/encode.c       |example of some encodings.                |
202 |sample/listcap.c      |example of the capture history.           |
203 |sample/posix.c        |POSIX API sample.                         |
204 |sample/scan.c         |example of using onig_scan().             |
205 |sample/sql.c          |example of the variable meta characters.  |
206 |sample/user_property.c|example of user defined Unicode property. |
207
208
209 Test Programs
210
211 |File               |Description                            |
212 |:------------------|:--------------------------------------|
213 |sample/syntax.c    |Perl, Java and ASIS syntax test.       |
214 |sample/crnl.c      |--enable-crnl-as-line-terminator test  |
215
216
217
218 Source Files
219 ------------
220
221 |File               |Description                                             |
222 |:------------------|:-------------------------------------------------------|
223 |oniguruma.h        |Oniguruma API header file (public)                      |
224 |onig-config.in     |configuration check program template                    |
225 |regenc.h           |character encodings framework header file               |
226 |regint.h           |internal definitions                                    |
227 |regparse.h         |internal definitions for regparse.c and regcomp.c       |
228 |regcomp.c          |compiling and optimization functions                    |
229 |regenc.c           |character encodings framework                           |
230 |regerror.c         |error message function                                  |
231 |regext.c           |extended API functions (deluxe version API)             |
232 |regexec.c          |search and match functions                              |
233 |regparse.c         |parsing functions.                                      |
234 |regsyntax.c        |pattern syntax functions and built-in syntax definitions|
235 |regtrav.c          |capture history tree data traverse functions            |
236 |regversion.c       |version info function                                   |
237 |st.h               |hash table functions header file                        |
238 |st.c               |hash table functions                                    |
239 |oniggnu.h          |GNU regex API header file (public)                      |
240 |reggnu.c           |GNU regex API functions                                 |
241 |onigposix.h        |POSIX API header file (public)                          |
242 |regposerr.c        |POSIX error message function                            |
243 |regposix.c         |POSIX API functions                                     |
244 |mktable.c          |character type table generator                          |
245 |ascii.c            |ASCII encoding                                          |
246 |euc_jp.c           |EUC-JP encoding                                         |
247 |euc_tw.c           |EUC-TW encoding                                         |
248 |euc_kr.c           |EUC-KR, EUC-CN encoding                                 |
249 |sjis.c             |Shift_JIS encoding                                      |
250 |big5.c             |Big5      encoding                                      |
251 |gb18030.c          |GB18030   encoding                                      |
252 |koi8.c             |KOI8      encoding                                      |
253 |koi8_r.c           |KOI8-R    encoding                                      |
254 |cp1251.c           |CP1251    encoding                                      |
255 |iso8859_1.c        |ISO-8859-1 (Latin-1)                                    |
256 |iso8859_2.c        |ISO-8859-2 (Latin-2)                                    |
257 |iso8859_3.c        |ISO-8859-3 (Latin-3)                                    |
258 |iso8859_4.c        |ISO-8859-4 (Latin-4)                                    |
259 |iso8859_5.c        |ISO-8859-5 (Cyrillic)                                   |
260 |iso8859_6.c        |ISO-8859-6 (Arabic)                                     |
261 |iso8859_7.c        |ISO-8859-7 (Greek)                                      |
262 |iso8859_8.c        |ISO-8859-8 (Hebrew)                                     |
263 |iso8859_9.c        |ISO-8859-9 (Latin-5 or Turkish)                         |
264 |iso8859_10.c       |ISO-8859-10 (Latin-6 or Nordic)                         |
265 |iso8859_11.c       |ISO-8859-11 (Thai)                                      |
266 |iso8859_13.c       |ISO-8859-13 (Latin-7 or Baltic Rim)                     |
267 |iso8859_14.c       |ISO-8859-14 (Latin-8 or Celtic)                         |
268 |iso8859_15.c       |ISO-8859-15 (Latin-9 or West European with Euro)        |
269 |iso8859_16.c       |ISO-8859-16 (Latin-10)                                  |
270 |utf8.c             |UTF-8    encoding                                       |
271 |utf16_be.c         |UTF-16BE encoding                                       |
272 |utf16_le.c         |UTF-16LE encoding                                       |
273 |utf32_be.c         |UTF-32BE encoding                                       |
274 |utf32_le.c         |UTF-32LE encoding                                       |
275 |unicode.c          |common codes of Unicode encoding                        |
276 |unicode_fold_data.c|Unicode folding data                                    |
277 |win32/Makefile     |Makefile for Win32 (VC++)                               |
278 |win32/config.h     |config.h for Win32                                      |