A Regular Expression Toolkit for regex-base
regex extends regex-base with:
- a text-replacement toolkit
- special datatypes for many matches, first match and individual captures
- compile-time checking of RE syntax
- a unified means of controlling case-sensitivity and multi-line options
- high-level AWK-like tools for building text processing apps
- the option of using match operators with reduced polymorphism on the text and/or result types
- regular expression macros including
- a number of useful RE macros
- a test bench for testing and documenting new macro environments
- built-in support for the TDFA and PCRE back ends
- comprehensive documentation and copious examples
☑ 2017-01-26 0.0.0.1 Pre-release (I)
☑ 2017-01-30 0.0.0.2 Pre-release (II)
☐ 2017-02-06 0.0.1.0 RFC
☐ 2017-02-20 0.1.0.0 a candidate stable release
☐ 2017-03-20 188.8.131.52 first stable release
If you have any feedback or suggestion then please drop me a line.
For details of the current release and the build pipelines see the Build Status page.
cabal update && cabal install regex
stack install regex
Loading up the Tutorial into ghci
First unpack the source distribution.
cabal unpack regex cd regex-*
Loading the tutorial into ghci with cabal:
cabal configure cabal repl re-tutorial
Loading the tutorial into ghci with stack:
stack --stack-yaml stack-8.0.yaml exec ghci -- -ghci-script lib/ghci examples/re-tutorial.lhs
Table of Contents
The Tutorial, Tests and Examples
provides an introduction to the package with simple examples that you can try out in your favourite Haskell REPL and references to examples in the example programs and library code.
provides an extended example of large-scale RE development with the regex test bench.
is the starting point for the preprocessor that we use to generate the tutorial HTML and its derived test suite.
is the Sed preprocessor we use to generate our cabal file from the template in lib/regex-master.cabal.
contains various test suites for exercising various components of the library.
contains the tool we use to generate the tutorial HTML and its derived test suite.
contains a tool for generating the parts of the API that can be easily synthesized from a seed/master module.
Selected Library Modules
Some of the library modules have been prepared as literate programs for easy browsing of their underlying source code.
contains the definitions of the
Capture data types (with helpers) that form the
foundations for everything else.
contains the text-replacement toolkit.
Options types for controlling RE parsing and compilation.
contains the IsRegex class for writing polymorphic regex tools that work with all regex back ends and text type combinations.
contains the test bench used to build the standard macro environment and can be used for developing other macro environments with test and documentation.
contains the polymorphic editing toolkit used by
contains the Sed tool for building awk-like text processors.
contains a simple grep tool for extracting lines that match a RE from a file.
contains a simple scanning tool for building prototype scanners before being discarded or converted into Alex scanners.
is an internal library module for dealing with named captures in REs.