regex-do-2.4: 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.MatchHint

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.MatchHint

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.MatchHint

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

match all

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

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

Text.Regex.Do.Pcre.MatchHint

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

match once

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

["all"]

Text.Regex.Do.Pcre.MatchHint

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

tweak Regex with options