regex-do-1.6: PCRE wrapper

Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Pcre.Match

Description

Synopsis

Documentation

class Match n h out where Source

match covers all

compiler looks up the appropriate function depending on the result type

(=~) is borrowed from Text.Regex.Posix.Wrap, is a short version of match. For those who put pattern & body in the right places.

Minimal complete definition

match

Methods

match :: Pattern n -> Body h -> out Source

(=~) :: n -> h -> out Source

Instances

Rx_ n h => Match n h Bool Source

test

>>> "в" =~ "тихо в лесу"::Bool

True

Rx_ n h => Match n h [[PosLen]] Source

match all

Rx_ n h => Match n h [PosLen] Source

match once

>>> ("и"::String) =~ ("бывает и хуже"::String)::[PosLen]

[(13,2)] Utf8

Rx_ n h => Match n h [[h]] Source

match all

>>> "well" =~ "all is well that ends well"::[[ByteString]]

[["well"],["well"]]

Rx_ n h => Match n h [h] Source

match once

>>> "^all" =~ "all the time"::[String]

["all"]

extract :: Extract source => (Int, Int) -> source -> source

extract takes an offset and length and has a default implementation of extract (off,len) source = before len (after off source)

extract is reexport from Text.Regex.Base.RegexLike

makeRegexOpts :: Opt_ n => [Comp] -> [Exec] -> Pattern n -> Regex Source

tweak Regex with options