regex-do-1.8: PCRE wrapper

Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Pcre.Match

Description

Synopsis

Documentation

class Match a b out where Source

match covers all result types

compiler looks up the appropriate function depending on the result type

=~ is borrowed from Text.Regex.PCRE.Wrap, is a short version of match

See also Text.Regex.Do.Pcre.MatchSame

Minimal complete definition

match

Methods

match :: Pattern a -> Body b -> out Source

(=~) Source

Arguments

:: a

pattern

-> b

body

-> out 

Instances

Rx_ a b => Match a b Bool Source

test

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

True

Text.Regex.Do.Pcre.MatchSame

Rx_ a b => Match a b [[PosLen]] Source

match all

Rx_ a b => Match a b [PosLen] Source

match once

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

[(13,2)]

Utf8

Text.Regex.Do.Pcre.MatchSame

Rx_ a b => Match a b [[b]] Source

match all

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

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

Text.Regex.Do.Pcre.MatchSame

Rx_ a b => Match a b [b] Source

match once

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

["all"]

Text.Regex.Do.Pcre.MatchSame

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_ a => [Comp] -> [Exec] -> Pattern a -> Regex Source

tweak Regex with options