Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
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
RegexLike Regex b => MatchOnce Regex b Bool Source # | test. always succeeds |
(Regex b, RegexLike Regex b) => MatchOnce b b (E [PosLen]) Source # |
Right [(8,2)] |
(Regex b, RegexLike Regex b) => MatchOnce b b (E Bool) Source # | test
Right True |
(Regex b, RegexLike Regex b) => MatchOnce b b (E [b]) Source # |
Right ["all"] |
RegexLike Regex b => MatchOnce Regex b [PosLen] Source # | always succeeds |
RegexLike Regex b => MatchOnce Regex b [b] Source # | always succeeds |
class MatchAll pattern body out where Source #
(Regex b, RegexLike Regex b) => MatchAll 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"]] |
RegexLike Regex b => MatchAll Regex b [[PosLen]] Source # | always succeeds |
RegexLike Regex b => MatchAll Regex b [[b]] Source # | always succeeds |
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