home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / regexps.zip / readme < prev    next >
Text File  |  1996-09-05  |  3KB  |  61 lines

  1. This is a revision of my well-known regular-expression package, regexp(3).
  2. It gives C programs the ability to use egrep-style regular expressions, and
  3. does it in a much cleaner fashion than the analogous routines in SysV.
  4. It is not, alas, fully POSIX.2-compliant; that is hard.  (I'm working on
  5. a full reimplementation that will do that.)
  6.  
  7. This version is the one which is examined and explained in one chapter of
  8. "Software Solutions in C" (Dale Schumacher, ed.; AP Professional 1994;
  9. ISBN 0-12-632360-7), plus a couple of insignificant updates, plus one
  10. significant bug fix (done 10 Nov 1995).
  11.  
  12. Although this package was inspired by the Bell V8 regexp(3), this
  13. implementation is *NOT* AT&T/Bell code, and is not derived from licensed
  14. software.  Even though U of T is a V8 licensee.  This software is based on
  15. a V8 manual page sent to me by Dennis Ritchie (the manual page enclosed
  16. here is a complete rewrite and hence is not covered by AT&T copyright).
  17. I admit to some familiarity with regular-expression implementations of
  18. the past, but the only one that this code traces any ancestry to is the
  19. one published in Kernighan & Plauger's "Software Tools" (from which
  20. this one draws ideas but not code).
  21.  
  22. Simplistically:  put this stuff into a source directory, inspect Makefile
  23. for compilation options that need changing to suit your local environment,
  24. and then do "make".  This compiles the regexp(3) functions, builds a
  25. library containing them, compiles a test program, and runs a large set of
  26. regression tests.  If there are no complaints, then put regexp.h into
  27. /usr/include, add regexp.o, regsub.o, and regerror.o into your C library
  28. (or put libre.a into /usr/lib), and install regexp.3 (perhaps with slight
  29. modifications) in your manual-pages directory. 
  30.  
  31. The files are:
  32.  
  33. COPYRIGHT    copyright notice
  34. README        this text
  35. Makefile    instructions to make everything
  36. regexp.3    manual page
  37. regexp.h    header file, for /usr/include
  38. regexp.c    source for regcomp() and regexec()
  39. regsub.c    source for regsub()
  40. regerror.c    source for default regerror()
  41. regmagic.h    internal header file
  42. try.c        source for test program
  43. timer.c        source for timing program
  44. tests        test list for try and timer
  45.  
  46. This implementation uses nondeterministic automata rather than the
  47. deterministic ones found in some other implementations, which makes it
  48. simpler, smaller, and faster at compiling regular expressions, but slower
  49. at executing them.  Many users have found the speed perfectly adequate,
  50. although replacing the insides of egrep with this code would be a mistake.
  51.  
  52. This stuff should be pretty portable, given an ANSI C compiler and
  53. appropriate option settings.  There are no "reserved" char values except for
  54. NUL, and no special significance is attached to the top bit of chars.
  55. The string(3) functions are used a fair bit, on the grounds that they are
  56. probably faster than coding the operations in line.  Some attempts at code
  57. tuning have been made, but this is invariably a bit machine-specific.
  58.  
  59. This distribution lives at ftp://ftp.zoo.toronto.edu/pub/bookregexp.{tar|shar}
  60. at present.
  61.