regex-do-3.2.2: PCRE wrapper
Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Replace.Utf8

Description

Synopsis

Documentation

class Replace hint pattern repl body out where Source #

see Text.Regex.Do.Replace.Latin for implemented types

GroupReplacer is implemented only for ByteString

Methods

replace :: (Extract' body, RegexLike Regex body) => hint pattern -> repl -> body -> out Source #

Instances

Instances details
Replace [] repl ByteString => Replace All Regex repl ByteString ByteString Source #

succeeds unless GroupReplacer fails due to mismatched pattern etc

repl: ByteString | GroupReplacer ByteString

Instance details

Defined in Text.Regex.Do.Replace.Utf8

Methods

replace :: All Regex -> repl -> ByteString -> ByteString Source #

Replace All Regex String String String Source #

always succeeds

Instance details

Defined in Text.Regex.Do.Replace.Utf8

Replace Maybe repl ByteString => Replace Once Regex repl ByteString ByteString Source #

succeeds unless GroupReplacer fails due to mismatched pattern etc

repl: ByteString | GroupReplacer ByteString

Instance details

Defined in Text.Regex.Do.Replace.Utf8

Methods

replace :: Once Regex -> repl -> ByteString -> ByteString Source #

Replace Once Regex String String String Source #

always succeeds

Instance details

Defined in Text.Regex.Do.Replace.Utf8

Replace All String String String (E String) Source # 
Instance details

Defined in Text.Regex.Do.Replace.Utf8

Replace All ByteString ByteString ByteString (E ByteString) Source # 
Instance details

Defined in Text.Regex.Do.Replace.Utf8

Replace Once String String String (E String) Source # 
Instance details

Defined in Text.Regex.Do.Replace.Utf8

Replace Once ByteString ByteString ByteString (E ByteString) Source # 
Instance details

Defined in Text.Regex.Do.Replace.Utf8

Replace All ByteString (GroupReplacer ByteString) ByteString (E ByteString) Source #
replacer::GroupReplacer ByteString
replacer = defaultReplacer 1 tweak1
      where tweak1 bs1 = toByteString' $
                        if bs1 == toByteString "左" then
                              "ー右ー"
                               else "?"


    runFn1 `shouldBe` toByteString "100メートルー右ー折後、左"
        where runFn1 = let rx1 = toByteString "(?<=ル)(左)"
                           body1 = toByteString "100メートル左折後、左"
                       in replace (All rx1) replacer body1    
Instance details

Defined in Text.Regex.Do.Replace.Utf8

Replace Once ByteString (GroupReplacer ByteString) ByteString (E ByteString) Source # 
Instance details

Defined in Text.Regex.Do.Replace.Utf8