|
Packit Service |
bd74e6 |
README.ja 2017/08/25
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
鬼車 ---- (C) K.Kosako <kkosako0@gmail.com>
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
https://github.com/kkos/oniguruma
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
鬼車は正規表現ライブラリである。
|
|
Packit Service |
bd74e6 |
このライブラリの特長は、それぞれの正規表現オブジェクトごとに
|
|
Packit Service |
bd74e6 |
文字エンコーディングを指定できることである。
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
サポートしている文字エンコーディング:
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,
|
|
Packit Service |
bd74e6 |
EUC-JP, EUC-TW, EUC-KR, EUC-CN,
|
|
Packit Service |
bd74e6 |
Shift_JIS, Big5, GB18030, KOI8-R, CP1251,
|
|
Packit Service |
bd74e6 |
ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,
|
|
Packit Service |
bd74e6 |
ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,
|
|
Packit Service |
bd74e6 |
ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
* GB18030: 久保健洋氏提供
|
|
Packit Service |
bd74e6 |
* CP1251: Byte氏提供
|
|
Packit Service |
bd74e6 |
------------------------------------------------------------
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
ライセンス
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
BSDライセンス
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
インストール
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
ケース1: UnixとCygwin環境
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
1. autoreconf -vfi (* configureスクリプトがないときだけ)
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
2. ./configure
|
|
Packit Service |
bd74e6 |
3. make
|
|
Packit Service |
bd74e6 |
4. make install
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
アンインストール
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
make uninstall
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
構成確認
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
onig-config --cflags
|
|
Packit Service |
bd74e6 |
onig-config --libs
|
|
Packit Service |
bd74e6 |
onig-config --prefix
|
|
Packit Service |
bd74e6 |
onig-config --exec-prefix
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
ケース2: Windows 64/32bit (Visual Studio)環境
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
make_win64 あるいは make_win32 を実行
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
onig_s.lib: static link library
|
|
Packit Service |
bd74e6 |
onig.dll: dynamic link library
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
* 動作テスト (ASCII/Shift_JIS)
|
|
Packit Service |
bd74e6 |
1. cd src
|
|
Packit Service |
bd74e6 |
2. copy ..\windows\testc.c .
|
|
Packit Service |
bd74e6 |
3. nmake -f Makefile.windows ctest
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
(Visual Studio Community 2015 で動作確認)
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
正規表現
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
doc/RE.jaを参照
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
使用方法
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
使用するプログラムで、oniguruma.hをインクルードする(Oniguruma APIの場合)。
|
|
Packit Service |
bd74e6 |
Oniguruma APIについては、doc/API.jaを参照。
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
oniguruma.hで定義されている型名UChar(== unsigned char)を無効にしたい場合
|
|
Packit Service |
bd74e6 |
には、ONIG_ESCAPE_UCHAR_COLLISIONをdefineしてからoniguruma.hをインクルード
|
|
Packit Service |
bd74e6 |
すること。このときにはUCharは定義されず、OnigUCharという名前の定義のみが
|
|
Packit Service |
bd74e6 |
有効になる。
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
oniguruma.hで定義されている型名regex_tを無効にしたい場合には、
|
|
Packit Service |
bd74e6 |
ONIG_ESCAPE_REGEX_T_COLLISIONをdefineしてからoniguruma.hをインクルード
|
|
Packit Service |
bd74e6 |
すること。このときにはregex_tは定義されず、OnigRegexType, OnigRegexという
|
|
Packit Service |
bd74e6 |
名前の定義のみが有効になる。
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
Unix/Cygwin上でコンパイル、リンクする場合の例:
|
|
Packit Service |
bd74e6 |
(prefixが/usr/localのとき)
|
|
Packit Service |
bd74e6 |
cc sample.c -L/usr/local/lib -lonig
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
GNU libtoolを使用しているので、プラットフォームが共有ライブラリをサポートして
|
|
Packit Service |
bd74e6 |
いれば、使用できるようになっている。
|
|
Packit Service |
bd74e6 |
静的ライブラリと共有ライブラリのどちらを使用するかを指定する方法、実行時点での
|
|
Packit Service |
bd74e6 |
環境設定方法については、自分で調べて下さい。
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
Win32でスタティックリンクライブラリ(onig_s.lib)をリンクする場合には、
|
|
Packit Service |
bd74e6 |
コンパイルするときに -DONIG_EXTERN=extern をコンパイル引数に追加すること。
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
使用例プログラム
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
sample/simple.c 最小例 (Oniguruma API)
|
|
Packit Service |
bd74e6 |
sample/names.c 名前付きグループコールバック使用例
|
|
Packit Service |
bd74e6 |
sample/encode.c 幾つかの文字エンコーディング使用例
|
|
Packit Service |
bd74e6 |
sample/listcap.c 捕獲履歴機能の使用例
|
|
Packit Service |
bd74e6 |
sample/posix.c POSIX API使用例
|
|
Packit Service |
bd74e6 |
sample/sql.c 可変メタ文字機能使用例 (SQL-like パターン)
|
|
Packit Service |
bd74e6 |
sample/user_property.c ユーザ定義Unicodeプロパティの使用例
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
テストプログラム
|
|
Packit Service |
bd74e6 |
sample/syntax.c Perl、Java、ASIS文法のテスト
|
|
Packit Service |
bd74e6 |
sample/crnl.c --enable-crnl-as-line-terminator テスト
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
ソースファイル
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
oniguruma.h 鬼車APIヘッダ (公開)
|
|
Packit Service |
bd74e6 |
onig-config.in onig-configプログラム テンプレート
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
regenc.h 文字エンコーディング枠組みヘッダ
|
|
Packit Service |
bd74e6 |
regint.h 内部宣言
|
|
Packit Service |
bd74e6 |
regparse.h regparse.cとregcomp.cのための内部宣言
|
|
Packit Service |
bd74e6 |
regcomp.c コンパイル、最適化関数
|
|
Packit Service |
bd74e6 |
regenc.c 文字エンコーディング枠組み
|
|
Packit Service |
bd74e6 |
regerror.c エラーメッセージ関数
|
|
Packit Service |
bd74e6 |
regext.c 拡張API関数
|
|
Packit Service |
bd74e6 |
regexec.c 検索、照合関数
|
|
Packit Service |
bd74e6 |
regparse.c 正規表現パターン解析関数
|
|
Packit Service |
bd74e6 |
regsyntax.c 正規表現パターン文法関数、組込み文法定義
|
|
Packit Service |
bd74e6 |
regtrav.c 捕獲履歴木巡回関数
|
|
Packit Service |
bd74e6 |
regversion.c 版情報関数
|
|
Packit Service |
bd74e6 |
st.h ハッシュテーブル関数宣言
|
|
Packit Service |
bd74e6 |
st.c ハッシュテーブル関数
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
oniggnu.h GNU regex APIヘッダ (公開)
|
|
Packit Service |
bd74e6 |
reggnu.c GNU regex API関数
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
onigposix.h POSIX APIヘッダ (公開)
|
|
Packit Service |
bd74e6 |
regposerr.c POSIX APIエラーメッセージ関数
|
|
Packit Service |
bd74e6 |
regposix.c POSIX API関数
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
mktable.c 文字タイプテーブル生成プログラム
|
|
Packit Service |
bd74e6 |
ascii.c ASCII エンコーディング
|
|
Packit Service |
bd74e6 |
euc_jp.c EUC-JP エンコーディング
|
|
Packit Service |
bd74e6 |
euc_tw.c EUC-TW エンコーディング
|
|
Packit Service |
bd74e6 |
euc_kr.c EUC-KR, EUC-CN エンコーディング
|
|
Packit Service |
bd74e6 |
sjis.c Shift_JIS エンコーディング
|
|
Packit Service |
bd74e6 |
big5.c Big5 エンコーディング
|
|
Packit Service |
bd74e6 |
gb18030.c GB18030 エンコーディング
|
|
Packit Service |
bd74e6 |
koi8.c KOI8 エンコーディング
|
|
Packit Service |
bd74e6 |
koi8_r.c KOI8-R エンコーディング
|
|
Packit Service |
bd74e6 |
cp1251.c CP1251 エンコーディング
|
|
Packit Service |
bd74e6 |
iso8859_1.c ISO-8859-1 (Latin-1)
|
|
Packit Service |
bd74e6 |
iso8859_2.c ISO-8859-2 (Latin-2)
|
|
Packit Service |
bd74e6 |
iso8859_3.c ISO-8859-3 (Latin-3)
|
|
Packit Service |
bd74e6 |
iso8859_4.c ISO-8859-4 (Latin-4)
|
|
Packit Service |
bd74e6 |
iso8859_5.c ISO-8859-5 (Cyrillic)
|
|
Packit Service |
bd74e6 |
iso8859_6.c ISO-8859-6 (Arabic)
|
|
Packit Service |
bd74e6 |
iso8859_7.c ISO-8859-7 (Greek)
|
|
Packit Service |
bd74e6 |
iso8859_8.c ISO-8859-8 (Hebrew)
|
|
Packit Service |
bd74e6 |
iso8859_9.c ISO-8859-9 (Latin-5 または Turkish)
|
|
Packit Service |
bd74e6 |
iso8859_10.c ISO-8859-10 (Latin-6 または Nordic)
|
|
Packit Service |
bd74e6 |
iso8859_11.c ISO-8859-11 (Thai)
|
|
Packit Service |
bd74e6 |
iso8859_13.c ISO-8859-13 (Latin-7 または Baltic Rim)
|
|
Packit Service |
bd74e6 |
iso8859_14.c ISO-8859-14 (Latin-8 または Celtic)
|
|
Packit Service |
bd74e6 |
iso8859_15.c ISO-8859-15 (Latin-9 または West European with Euro)
|
|
Packit Service |
bd74e6 |
iso8859_16.c ISO-8859-16
|
|
Packit Service |
bd74e6 |
(Latin-10 または South-Eastern European with Euro)
|
|
Packit Service |
bd74e6 |
utf8.c UTF-8 エンコーディング
|
|
Packit Service |
bd74e6 |
utf16_be.c UTF-16BE エンコーディング
|
|
Packit Service |
bd74e6 |
utf16_le.c UTF-16LE エンコーディング
|
|
Packit Service |
bd74e6 |
utf32_be.c UTF-32BE エンコーディング
|
|
Packit Service |
bd74e6 |
utf32_le.c UTF-32LE エンコーディング
|
|
Packit Service |
bd74e6 |
unicode.c Unicodeエンコーディングの共通処理
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
win32/Makefile Win32用 Makefile (for VC++)
|
|
Packit Service |
bd74e6 |
win32/config.h Win32用 config.h
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
|
|
Packit Service |
bd74e6 |
and I'm thankful to Akinori MUSHA.
|