Walter Waldo's port of Henry Spencer's regular expression library from Tcl.
garyhouston/hsrex
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
This is a port to make standalone available the Henry Spencer's Regex Library from Tcl 8.6a2. In the hope that the Tcl developers take this port as the base for their RE module, great effort was paid to not update the *.c files, sadly it was not possible. Some *.h files suffered dirty updates for the same reasons. To build and test make ./regtest_hsrex.sh To rebuild make clean make To build against the other library uncomment the proper line in the file regtest_hsrex.sh and execute again. # Either this one $CC -I. -I$H/inc -L. -lhsrex -o $rgbin $rgsrc # or this one #$CC -I. -I$H/inc -L. -lhswrex -DREGEX_WCHAR -o $rgbin $rgsrc You would like to test with debuging information. Uncomment the proper line in the Makefile and rebuild. # Either this one #CFLAGS = -DREGEX_STANDALONE -fPIC -DREG_DEBUG -g # Or this one CFLAGS = -DREGEX_STANDALONE -fPIC -D_NDEBUG -O3 Two libraries are provided, libhsrex.so and libhswrex.so. The first one is for ascii character code and the second one for wide characters. Both libraries were tested in Linux and Solaris. Compiling and runing in Window$ should be easy. The following entry point where defined in each library: re_comp() (re_wcomp() for wide char) to compile a RE re_exec() (re_wexec() for wide char) to parse data against a compiled RE. regfree() To dispose the memory of a compiled RE. regerror() Translates error codes to ascii strings. It is pretty easy to add support for a regcomp() regexec() front end. That front end functions should take care of UTF-8 to wide charater conversion, for instance. The regression test script regtest_hsrex.sh contains an example of how to use the libraries. It just test cases I was interested on. Adding more use cases to that script should be easy. Send any comments to Walter Waldo <wawasa@gmail.com> Enjoy it, Walter Waldo.
About
Walter Waldo's port of Henry Spencer's regular expression library from Tcl.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published