regex-do-3.2.2: PCRE wrapper
Safe HaskellNone
LanguageHaskell2010

Text.Regex.Do.Split

Description

see Data.ByteString.Search package

break, split ops on ByteString

regex is treated as ordinary String

break & split are now /, -/, /-

replace moved to Text.Regex.Do.Replace.Fast

Synopsis

Documentation

class Split out where Source #

slices ByteString. drops needle

to avoid clash with Prelude:

import Prelude hiding((/))

or qualify / with alias e.g. (assuming this module is imported with S alias):

S./

body -> pattern -> result

Methods

(/) :: ByteString -> ByteString -> out Source #

Instances

Instances details
Split [ByteString] Source #
>>> "a bc de" / " "      -- space may be used

["a", "bc", "de"]

Instance details

Defined in Text.Regex.Do.Split

Split (ByteString, ByteString) Source #
>>> "a\nbc\nde" / "\n"

("a", "bc\nde")

Instance details

Defined in Text.Regex.Do.Split

class SplitFront out where Source #

keep needle @ front

Methods

(-/) :: ByteString -> ByteString -> out Source #

Instances

Instances details
SplitFront [ByteString] Source #
>>> "a\nbc\nde" -/ "\n"

["a", "\nbc", "\nde"]

Instance details

Defined in Text.Regex.Do.Split

SplitFront (ByteString, ByteString) Source #
>>> "a\nbc\nde" -/ "\n"

("a", "\nbc\nde")

Instance details

Defined in Text.Regex.Do.Split

class SplitEnd out where Source #

keep needle @ end

Methods

(/-) :: ByteString -> ByteString -> out Source #

Instances

Instances details
SplitEnd [ByteString] Source #
>>> "a\nbc\nde" /- "\n"

["a\n", "bc\n", "de"]

Instance details

Defined in Text.Regex.Do.Split

SplitEnd (ByteString, ByteString) Source #
>>> "a\nbc\nde" /- "\n"

("a\n", "bc\nde")

Instance details

Defined in Text.Regex.Do.Split

type T = (ByteString, ByteString) Source #

Break result: tuple

type L = [ByteString] Source #

Split result: list