Tutorial
Home » Tutorial
The regex Tutorials
We have five tutorials, each of which is a literate Haskell program with interactive examples that can be tried out with ghci.
The regex tutorial covers basic usage only. (This tutorial is incomplete.)
The regex replacing tutorial covers the general regex replacement toolkit including a detailed look at the
Matches
andMatch
types. (This tutorial is incomplete.)The regex options tutorial covers the different ways of specifying configuring RE parsing and compilation. (This tutorial is incomplete.)
The regex tools tutorial looks at the regex tools, including a detailed look at the
IsRegex
class. (This tutorial is incomplete.)The regex testbench tutorial looks at the regex test bench through the
re-nginx-log-processor
example. (This tutorial is incomplete.)
Loading the Tutorial with Cabal
First unpack the source distribution and change into the root folder
cabal unpack regex
cd regex-*
And load the tutorial into ghci with cabal:
cabal configure
cabal repl re-tutorial
Loading the Tutorial with Stack
To load the tutorial into ghc-8.0 with stack (from the unpacked root folder):
stack --stack-yaml stack-8.0.yaml exec ghci -- -ghci-script lib/ghci examples/re-tutorial.lhs