module Text.Regex.Do.Pcre.Match where
import qualified Text.Regex.Base.RegexLike as R hiding (makeRegex)
import qualified Text.Regex.Base.RegexLike as R (makeRegex)
import Text.Regex.Do.TypeDo
import Text.Regex.Do.Pcre.Option as O
import Text.Regex.Do.TypeRegex
import Data.ByteString
class Rx_ n h =>
Match n h where
matchOnce::Pattern n -> Body h -> Maybe MatchArray
matchOnce r0 (Body b0) = R.matchOnce (r_ r0) b0
matchTest::Pattern n -> Body h -> Bool
matchTest r0 (Body b0) = R.matchTest (r_ r0) b0
matchAll::Pattern n -> Body h -> [MatchArray]
matchAll r0 (Body b0) = R.matchAll (r_ r0) b0
makeRegexOpts::Opt_ n =>
[O.Comp] -> [O.Exec] -> Pattern n -> Regex
makeRegexOpts comp0 exec0 (Pattern pat0) = rx1
where c1 = O.comp comp0
e1 = O.exec exec0
rx1 = R.makeRegexOpts c1 e1 pat0
instance Match String String
instance Match String ByteString
instance Match ByteString ByteString
instance Match ByteString String
instance Match Regex String
instance Match Regex ByteString
class Regex_ r where
r_::Pattern r -> Regex
instance Regex_ ByteString where
r_ (Pattern r0) = R.makeRegex r0
instance Regex_ String where
r_ (Pattern r0) = R.makeRegex r0
instance Regex_ Regex where
r_ (Pattern r0) = r0
type Rx_ n h = (R.Extract h, Regex_ n, R.RegexLike Regex h)