From bda12e168733451328e39aceb6b2625f6b28e29c Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 26 Jun 2026 23:20:37 +0200 Subject: added new project README The original hsrex README has been re-added as README.old. --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..f3b39ab --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# TECO Regular Expression Engine + +This is a regular expression engine, derived from the standalone +[hsrex](https://github.com/garyhouston/hsrex) library, which +is based on Henry Spencer's implementation of advanced regular expressions +(ARE) in the Tcl language. +This library therefore also provides AREs +(see [re_syntax](https://www.tcl-lang.org/man/tcl/TclCmd/re_syntax.html)). +In contrast to [PCRE](https://www.pcre.org/) terex' stack +use cannot grow arbitrarily and it has polynomial worst-case runtime. +terex is the regular expression engine used by the [SciTECO](https://sciteco.fmsbw.de) +editor and motivated by its needs. +It is still kept as a standalone library and may be useful to other projects as well. + +Compared to hsrex, this library has the following changes: + +* Native UTF-8 support - no need to convert UTF-8 to UTF-32 first. + You no longer need to compile a special version of the library. + It expects Unicode strings by default unless specifying the `REG_RAW` + compilation and execution flag. + +## TODO + +* Hook into the matching algorithm. + Even though runtime cannot be as catastrophically bad as in pure + backtracking engines like PCRE, `re_exec()` calls can still be slow + on extremely large texts. + The hook allows interruptions. +* Expose enough API to swap out the regular expression lexer. + Useful for custom DSLs like glob patterns or TECO patterns. +* Support splitting the subject string into two halves, so we can + preserve the buffer gap when used in SciTECO. +* Check for useful changes in the Tcl codebase. +* Check against a proper regular expression test suite. + +## Building + + make -f Makefile.linux + +There is also an Automake file (Makefile.am) for integration into an existing +Autotools build system. -- cgit v1.2.3