regex-pcre-text-0.94.0.1: Text-based PCRE API for regex-base

Safe HaskellNone
LanguageHaskell2010

Text.Regex.PCRE.Text.Lazy

Contents

Synopsis

Types

type MatchOffset = Int #

0 based index from start of source, or (-1) for unused

type MatchLength = Int #

non-negative length of a match

newtype CompOption :: * #

Constructors

CompOption CInt 

Instances

Eq CompOption 
Num CompOption 
Show CompOption 
Bits CompOption 
RegexOptions Regex CompOption ExecOption 

newtype ExecOption :: * #

Constructors

ExecOption CInt 

Instances

Eq ExecOption 
Num ExecOption 
Show ExecOption 
Bits ExecOption 
RegexOptions Regex CompOption ExecOption 

Miscellaneous

getVersion :: Maybe String #

return version of pcre used or Nothing if pcre is not available.

Medium level API functions

compile Source #

Arguments

:: CompOption

(summed together)

-> ExecOption

(summed together)

-> Text

The regular expression to compile

-> IO (Either (MatchOffset, String) Regex)

Returns: the compiled regular expression

Compiles a regular expression

execute Source #

Arguments

:: Regex

Compiled regular expression

-> Text

Text to match against

-> IO (Either WrapError (Maybe (Array Int (MatchOffset, MatchLength))))

Returns: Nothing if the regex did not match the string, or Just an array of (offset,length) pairs where index 0 is whole match, and the rest are the captured subexpressions.

Matches a regular expression against a string

regexec Source #

Arguments

:: Regex

Compiled regular expression

-> Text

Text to match against

-> IO (Either WrapError (Maybe (Text, Text, Text, [Text])))

Returns: Nothing if the regex did not match the string, or Just text including before and after text

Matches a regular expression against a string

CompOption flags

ExecOption flags

Orphan instances