regex-do-3.2: PCRE wrapper

Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Match.Latin

Description

although sometimes funs in Ascii modules work with non-ascii text (as some examples show), for reliable results with Utf8 pattern or body, use Text.Regex.Do.Match.Utf8

see also Text.Regex.Base.RegexLike

Synopsis

Documentation

class MatchOnce pattern body out where Source #

API changes:

Once is hinted with ~?

All is hinted with ~*

All regex-computing instances catch regex errors, return Either String out (Left String is the error message)

String | ByteString pattern may contains regex

precompiled Regex may be used as pattern too. see Text.Regex.Do.Match.Utf8

Minimal complete definition

(~?)

Methods

(~?) :: pattern -> body -> out Source #

Instances

RegexLike Regex b => MatchOnce Regex b Bool Source #

test.

always succeeds

Methods

(~?) :: Regex -> b -> Bool Source #

(Regex b, RegexLike Regex b) => MatchOnce b b (E [PosLen]) Source #
>>> "à" ~? "tourner à gauche"::E [PosLen]

Right [(8,2)]

Methods

(~?) :: b -> b -> E [PosLen] Source #

(Regex b, RegexLike Regex b) => MatchOnce b b (E Bool) Source #

test

>>> "chilly" ~? "it's chilly inside, chilly outside"::E Bool

Right True

Methods

(~?) :: b -> b -> E Bool Source #

(Regex b, RegexLike Regex b) => MatchOnce b b (E [b]) Source #
>>> "^all" ~? "all the time"::E [String]

Right ["all"]

Methods

(~?) :: b -> b -> E [b] Source #

RegexLike Regex b => MatchOnce Regex b [PosLen] Source #

always succeeds

Methods

(~?) :: Regex -> b -> [PosLen] Source #

RegexLike Regex b => MatchOnce Regex b [b] Source #

always succeeds

Methods

(~?) :: Regex -> b -> [b] Source #

class MatchAll pattern body out where Source #

Minimal complete definition

(~*)

Methods

(~*) :: pattern -> body -> out Source #

Instances

(Regex b, RegexLike Regex b) => MatchAll b b (E [[PosLen]]) Source # 

Methods

(~*) :: b -> b -> E [[PosLen]] Source #

(Regex b, RegexLike Regex b) => MatchAll b b (E [[b]]) Source #
"chilly" ~* "it's chilly inside, chilly outside"::E [[ByteString]]

Right [["chilly"],["chilly"]]   
     

Methods

(~*) :: b -> b -> E [[b]] Source #

RegexLike Regex b => MatchAll Regex b [[PosLen]] Source #

always succeeds

Methods

(~*) :: Regex -> b -> [[PosLen]] Source #

RegexLike Regex b => MatchAll Regex b [[b]] Source #

always succeeds

Methods

(~*) :: Regex -> b -> [[b]] Source #

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