Module RegExp

A library to defined and match regular expressions. This library is used to translated integrated code in the form of POSIX extended regular expressions into Curry programs.

Author: Jasper Sikorra

Version: July 2017

Summary of exported operations:

match :: [ORegExp a] -> [a] -> Bool   
The match function is used to match lists with regular expressions

Exported datatypes:


RegExp

Data type for regex representation in Curry

Type synonym: RegExp a = [ORegExp a]


ORegExp

Constructors:

  • Nil :: ORegExp a
  • Literal :: a -> ORegExp a
  • Xor :: (RegExp a) -> (RegExp a) -> ORegExp a
  • Star :: (RegExp a) -> ORegExp a
  • Plus :: (RegExp a) -> ORegExp a
  • AnyLiteral :: ORegExp a
  • Bracket :: [Either a (a,a)] -> ORegExp a
  • NegBracket :: [Either a (a,a)] -> ORegExp a
  • Start :: (RegExp a) -> ORegExp a
  • End :: (RegExp a) -> ORegExp a
  • Times :: (Int,Int) -> (RegExp a) -> ORegExp a

Exported operations:

match :: [ORegExp a] -> [a] -> Bool   

The match function is used to match lists with regular expressions

Example call:
(match r s)
Parameters:
  • r : The regular expression
  • s : The input list