Giter Site home page Giter Site logo

posix-regex's Introduction

posix-regex

CHICKEN egg for POSIX regular expressions supporting POSIX EREs and BREs.

Motivation

CHICKEN's default regex library only supports POSIX EREs with PCRE extensions. Unfourtunatly, I needed a strict POSIX-compliant BRE implementation, without any extensions, for my implementation of the ed text editor in CHICKEN Scheme. For 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. However, the code for wrapping these functions became more complex over time (e.g. due to support for better error messages via regerror(3)). As 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.

Features

  • Thin wrappers for regcomp(3) and regexec(3)
  • Error handling via R7RS exceptions and a regerror(3) wrapper
  • API with strict CHICKEN type annotations
  • Support for submatches via R7RS bytevectors

Installation

This library is available in the CHICKEN egg repository and can be installed using:

$ chicken-install posix-regex

Documentation

The documentation is maintained separately in the CHICKEN wiki.

Initially, the documentation was partially generated with schematic from inline comments using:

$ schematic-wiki -c ';;>' < posix-regex.scm

Usage

For an elaborate usage example, refer to the source code of the edward text editor.

License

This library is licensed under GPL-3.0-only.

posix-regex's People

Contributors

nmeum avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.