posix-regex

CHICKEN Scheme wrapper for POSIX regular expression matching

git clone https://git.8pit.net/posix-regex.git

 1# posix-regex
 2
 3[CHICKEN][chicken web] egg for POSIX regular expressions supporting [POSIX EREs and BREs][opengroup regex].
 4
 5## Motivation
 6
 7[CHICKEN's default regex library][chicken irregex] only supports POSIX EREs with PCRE extensions.
 8Unfourtunatly, I needed a strict POSIX-compliant BRE implementation, without any extensions, for [my implementation of the ed text editor][edward github] in CHICKEN Scheme.
 9For this reason, I originally used CHICKEN's Foreign Function Interface to use the POSIX `regcomp(3)` and `regexec(3)` functions directly in the codebase of my editor.
10However, the code for wrapping these functions became more complex over time (e.g. due to support for better error messages via `regerror(3)`).
11As such, I decided to move it to a dedicated library which may be useful for other CHICKEN Schemers which are looking for a pure POSIX BRE or ERE implementation.
12
13## Features
14
15* Thin wrappers for `regcomp(3)` and `regexec(3)`
16* Error handling via [R7RS][r7rs] exceptions and a `regerror(3)` wrapper
17* API with strict [CHICKEN][chicken types] type annotations
18* Support for submatches via R7RS bytevectors
19
20## Installation
21
22This library is available in the CHICKEN egg repository and can be installed using:
23
24	$ chicken-install posix-regex
25
26## Documentation
27
28The documentation is maintained separately in the [CHICKEN wiki][chicken posix-regex].
29
30Initially, the documentation was partially generated with [schematic][chicken schematic] from inline comments using:
31
32	$ schematic-wiki -c ';;>' < posix-regex.scm
33
34## Usage
35
36For an elaborate usage example, refer to the source code of the [edward][edward github] text editor.
37
38## License
39
40This library is licensed under [GPL-3.0-only][spdx gpl-3.0-only].
41
42[chicken web]: https://call-cc.org
43[opengroup regex]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html
44[chicken irregex]: https://wiki.call-cc.org/man/5/Module%20(chicken%20irregex)
45[edward github]: https://github.com/nmeum/edward
46[r7rs]: https://small.r7rs.org/
47[chicken types]: https://wiki.call-cc.org/man/5/Types
48[chicken posix-regex]: https://wiki.call-cc.org/eggref/5/posix-regex
49[spdx gpl-3.0-only]: https://spdx.org/licenses/GPL-3.0-only.html
50[chicken schematic]: https://wiki.call-cc.org/eggref/5/schematic