regex-do-3.2: PCRE wrapper

Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Match.Utf8

Description

see Text.Regex.Base.RegexLike

see Text.Regex.Do.Match.Latin for API changes

toByteString converts String to utf8 ByteString

Synopsis

Documentation

class MatchOnce pattern body out where Source #

Minimal complete definition

(~?)

Methods

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

Instances

RegexLike Regex b => MatchOnce Regex b Bool Source #

b: String, ByteString

always succeeds

Methods

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

MatchOnce String String (E Bool) Source #

test

>>> ("в"::String) ~? ("тихо в лесу"::String)::E Bool

Right True

Methods

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

MatchOnce String String (E [String]) Source #
>>> ("^熱"::String) ~? ("熱い午後"::String)::E [String]

Right ["熱"]

Methods

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

MatchOnce String String (E [PosLen]) Source # 

Methods

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

MatchOnce ByteString ByteString (E Bool) Source # 
MatchOnce ByteString ByteString (E [ByteString]) Source # 
MatchOnce ByteString ByteString (E [PosLen]) Source # 
RegexLike Regex b => MatchOnce Regex b [PosLen] Source #

b: String, ByteString

always succeeds

Methods

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

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

b: String, ByteString

always succeeds

precompiled regex as pattern

let Right rx1 = makeRegexOpt (toByteString "左") [Utf8] []      --  add options as needed
    m1 = rx1 ~? (toByteString "100メートル左折後、左")::[ByteString]
m1 shouldBe [toByteString "左"]       

Methods

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

class MatchAll pattern body out where Source #

Minimal complete definition

(~*)

Methods

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

Instances

MatchAll String String (E [[String]]) Source #
>>> ("лес"::String) ~* ("Залесью, залесью…"::String)::E [[String]]

Right [["лес"],["лес"]]

Methods

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

MatchAll String String (E [[PosLen]]) Source # 

Methods

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

MatchAll ByteString ByteString (E [[ByteString]]) Source # 
MatchAll ByteString ByteString (E [[PosLen]]) Source # 

Methods

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

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

b: String, ByteString

always succeeds

Methods

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

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

b: String, ByteString

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