![]() | Library Documentation | Structures | Signatures | Identifiers | Packages | About |
REG_EXP (pkg github.com/diku-dk/sml-regexp)NFA implementation of regular expression matching.
structure RegExp : REG_EXP (pkg github.com/diku-dk/sml-regexp)
signature REG_EXP =
sig
type regexp
val fromString : string -> regexp
val match : regexp -> string -> bool
val extract : regexp -> string -> string list option
end
re ::= re1 "|" re2 re1 or re2
| re1 re2 re1 followed by re2
| re "*" re repeated zero or more times
| re "+" re repeated one or more times
| re "?" re zero or one time
| "(" re ")" re
| c specific character
| "\" c escaped character; c is one of |,*,+,?,(,),[,],$,.,\,t,n,v,f,r
| "[" class "]" character class
| "[^" class "]" negated character class
| $ empty string
| . any character
class ::= c specific character
| "\" c escaped character; c is one of [,],-,\,t,n,v,f,r
| c1 "-" c2 ascii character range
| empty class
| class class composition
Whitespace is significant. Special characters can be escaped by \.
Authors: Ken Friis Larsen. Support for regular expression classes and
parenthesis extraction by Martin Elsman.