README  2003/12/24

Oniguruma  ----   (C) K.Kosako <kosako@sofnec.co.jp>

http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/
http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/

Oniguruma is a regular expression library.
The characteristics of this library is that different character encoding
for every regular expression object can be specified.

Supported character encodings:
  ASCII, ISO 8859-1, ISO 8859-15, UTF-8, EUC-JP, Shift_JIS, Big5

There are two ways of using of it in this program.

  * Built-in regular expression engine of Ruby
  * C library (supported APIs: GNU regex, POSIX, Oniguruma native)


Install

(A) Install into Ruby

   See INSTALL-RUBY.

   (character encodings:  ASCII, UTF-8, EUC-JP, Shift_JIS)


(B) Install C library

 (B-1) Unix and Cygwin platform

   1. ./configure
   2. make
   3. make install

   (* uninstall:  make uninstall)

  * test (ASCII/EUC-JP)
   4. make ctest


 (B-2) Win32 platform (VC++)

   1. copy win32\Makefile Makefile
   2. copy win32\config.h config.h
   3. nmake

      onig_s.lib:  static link library
      onig.dll:    dynamic link library

  * test (ASCII/Shift_JIS)
   4. copy win32\testc.c testc.c
   5. nmake ctest



License

   When this software is partly used or it is distributed with Ruby, 
   this of Ruby follows the license of Ruby.
   It follows the BSD license in the case of the one except for it.



Regular Expression

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



Source Files

  oniguruma.h        Oniguruma and GNU regex API header file
  regenc.h           character encodings framework header file.
  regint.h           internal definitions
  regparse.h         internal definitions for regparse.c and regcomp.c
  regcomp.c          compiling and optimization functions
  regenc.c           character encodings framework.
  regerror.c         error message function
  regex.c            source files wrapper for Ruby
  regexec.c          search and match functions
  regparse.c         parsing functions.
  reggnu.c           GNU regex API functions

  enc/ascii.c        ASCII encoding.
  enc/iso8859_1.c    ISO 8859-1 encoding.
  enc/iso8859_15.c   ISO 8859-15 encoding. (Latin 9)
  enc/utf8.c         UTF-8 encoding.
  enc/eucjp.c        EUC-JP encoding.
  enc/sjis.c         Shift_JIS encoding.
  enc/big5.c         Big5 encoding.

  onigposix.h        POSIX API header file
  regposerr.c        POSIX API error message function (regerror)
  regposix.c         POSIX API functions

  sample/simple.c    example of the minimum (native API)
  sample/names.c     example of the named group callback.
  sample/encode.c    example of some encodings.
  sample/listcap.c   example of the capture history.
  sample/posix.c     POSIX API sample.
  sample/sql.c       example of the variable meta characters.
                     (SQL-like pattern matching)



API differences with Japanized GNU regex(version 0.12) of Ruby

   + re_compile_fastmap() is removed.
   + re_recompile_pattern() is added.
   + re_alloc_pattern() is added.


ToDo

  1 support 16-bit and 31-bit encodings. (UCS-2, UCS-4, UTF-16)
  2 different encoding pattern with target.
    (ex. ASCII/UCS-2, UCS-2 BE and UCS-2 LE)
  3 optimize by collect common part of string of alternatives.

  ? /a{n}?/ should be interpreted as /(?:a{n})?/
  ? transmission stopper. (return REG_STOP from match_at())
  ? implement syntax behavior REG_SYN_CONTEXT_INDEP_ANCHORS.
  ? better acess to hash table.
    non null-terminated key version st_lookup().
  ? grep-like tool 'onigrep'.


and I'm thankful to Akinori MUSHA.
