diff --git a/README.markdown b/README.markdown
--- a/README.markdown
+++ b/README.markdown
@@ -68,6 +68,8 @@
 
 &nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-28  v0.10.0.3 [Upgrade to LTS 8.6 and Improve Haddocks for Text.RE.{TDFA,PCRE}](https://github.com/iconnect/regex/milestone/13)
 
+&nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-29  v0.11.0.0 [Simplify the API](https://github.com/iconnect/regex/milestone/14)
+
 &nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-03-31  v1.0.0.0  [First stable release](https://github.com/iconnect/regex/milestone/3)
 
 &nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-08-31  v2.0.0.0  [Fast text replacement with benchmarks](https://github.com/iconnect/regex/milestone/4)
diff --git a/Text/RE/Internal/QQ.hs b/Text/RE/Internal/QQ.hs
deleted file mode 100644
--- a/Text/RE/Internal/QQ.hs
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable         #-}
-
-module Text.RE.Internal.QQ where
-
-import           Control.Exception
-import           Data.Typeable
-import           Language.Haskell.TH.Quote
-
-
--- | used to throw an exception reporting an abuse of a quasi quoter
-data QQFailure =
-  QQFailure
-    { _qqf_context   :: String  -- ^ in what context was the quasi quoter used
-    , _qqf_component :: String  -- ^ how was the quasi quoter being abused
-    }
-  deriving (Show,Typeable)
-
-instance Exception QQFailure where
-
--- | a quasi quoter that can be used in no context (to be extended with
--- the appropriate quasi quoter parser)
-qq0 :: String -> QuasiQuoter
-qq0 ctx =
-  QuasiQuoter
-    { quoteExp  = const $ throw $ QQFailure ctx "expression"
-    , quotePat  = const $ throw $ QQFailure ctx "pattern"
-    , quoteType = const $ throw $ QQFailure ctx "type"
-    , quoteDec  = const $ throw $ QQFailure ctx "declaration"
-    }
diff --git a/Text/RE/Internal/SearchReplace.hs b/Text/RE/Internal/SearchReplace.hs
deleted file mode 100644
--- a/Text/RE/Internal/SearchReplace.hs
+++ /dev/null
@@ -1,84 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude          #-}
-{-# LANGUAGE RecordWildCards            #-}
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-{-# OPTIONS_GHC -fno-warn-orphans       #-}
-
-module Text.RE.Internal.SearchReplace
-  ( unsafeCompileSearchReplace_
-  , compileSearchReplace_
-  , compileSearchAndReplace_
-  ) where
-
-import qualified Data.HashMap.Strict            as HMS
-import           Prelude.Compat
-import           Text.RE.Internal.NamedCaptures
-import           Text.RE.Types.Capture
-import           Text.RE.Types.CaptureID
-import           Text.RE.Types.Matches
-import           Text.RE.Types.Replace
-import           Text.RE.Types.SearchReplace
-import qualified Text.Regex.TDFA                as TDFA
-
-
--- | warapper on 'compileSearchReplace_' that will generate an error
--- if any compilation errors are found
-unsafeCompileSearchReplace_ :: (String->s)
-                            -> (String->Either String re)
-                            -> String
-                            -> SearchReplace re s
-unsafeCompileSearchReplace_ pk cf = either err id . compileSearchReplace_ pk cf
-  where
-    err msg = error $ "unsafeCompileSearchReplace_: " ++ msg
-
--- | compile a SearchReplace template generating errors if the RE or
--- the template are not well formed -- all capture references being checked
-compileSearchReplace_ :: (Monad m,Functor m)
-                      => (String->s)
-                      -> (String->Either String re)
-                      -> String
-                      -> m (SearchReplace re s)
-compileSearchReplace_ pack compile_re sr_tpl = either fail return $ do
-    case mainCaptures $ sr_tpl $=~ "///" of
-      [cap] ->
-        compileSearchAndReplace_ pack compile_re
-                      (capturePrefix cap) (captureSuffix cap)
-      _ -> Left $ "bad search-replace template syntax: " ++ sr_tpl
-
--- | compile 'SearcgReplace' from two strings containing the RE
--- and the replacement template
-compileSearchAndReplace_ :: (Monad m,Functor m)
-                         => (String->s)
-                         -> (String->Either String re)
-                         -> String
-                         -> String
-                         -> m (SearchReplace re s)
-compileSearchAndReplace_ pack compile_re re_s tpl = either fail return $ do
-    re           <- compile_re re_s
-    ((n,cnms),_) <- extractNamedCaptures re_s
-    mapM_ (check n cnms) $ templateCaptures id tpl
-    return $ SearchReplace re $ pack tpl
-  where
-    check :: Int -> CaptureNames -> CaptureID -> Either String ()
-    check n cnms cid = case cid of
-      IsCaptureOrdinal co -> check_co n    co
-      IsCaptureName    cn -> check_cn cnms cn
-
-    check_co n (CaptureOrdinal i) = case i <= n of
-      True  -> return ()
-      False -> Left $ "capture ordinal out of range: " ++
-                                      show i ++ " >= " ++ show n
-
-    check_cn cnms cnm = case cnm `HMS.member` cnms of
-      True  -> return ()
-      False -> Left $ "capture name not defined: " ++
-                                      show (getCaptureName cnm)
-
-($=~) :: String -> String -> Matches String
-($=~) = (TDFA.=~)
diff --git a/Text/RE/Internal/SearchReplace/PCRE.hs b/Text/RE/Internal/SearchReplace/PCRE.hs
deleted file mode 100644
--- a/Text/RE/Internal/SearchReplace/PCRE.hs
+++ /dev/null
@@ -1,54 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude          #-}
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-
-module Text.RE.Internal.SearchReplace.PCRE
-  ( ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_
-  ) where
-
-import           Language.Haskell.TH
-import           Language.Haskell.TH.Quote
-import           Prelude.Compat
-import           Text.RE.Internal.SearchReplace.PCREEdPrime
-import           Text.RE.Types.REOptions
-
-
--- | the @[ed| ... /// ... |]@ quasi quoters
-ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_ :: QuasiQuoter
-
-ed                       = ed' cast $ Just minBound
-edMS                     = edMultilineSensitive
-edMI                     = edMultilineInsensitive
-edBS                     = edBlockSensitive
-edBI                     = edBlockInsensitive
-edMultilineSensitive     = ed' cast $ Just  MultilineSensitive
-edMultilineInsensitive   = ed' cast $ Just  MultilineInsensitive
-edBlockSensitive         = ed' cast $ Just  BlockSensitive
-edBlockInsensitive       = ed' cast $ Just  BlockInsensitive
-ed_                      = ed' cast   Nothing
-
-cast :: Q Exp
-cast = [|id|]
diff --git a/Text/RE/Internal/SearchReplace/PCRE/ByteString.hs b/Text/RE/Internal/SearchReplace/PCRE/ByteString.hs
deleted file mode 100644
--- a/Text/RE/Internal/SearchReplace/PCRE/ByteString.hs
+++ /dev/null
@@ -1,58 +0,0 @@
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-
-module Text.RE.Internal.SearchReplace.PCRE.ByteString
-  ( ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_
-  ) where
-
-import qualified Data.ByteString.Char8         as B
-import           Language.Haskell.TH
-import           Language.Haskell.TH.Quote
-import           Text.RE.PCRE.RE
-import           Text.RE.Internal.SearchReplace.PCREEdPrime
-import           Text.RE.SearchReplace
-import           Text.RE.Types.REOptions
-
-
--- | the @[ed| ... /// ... |]@ quasi quoters
-ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_ :: QuasiQuoter
-
-ed                       = ed' sr_cast $ Just minBound
-edMS                     = edMultilineSensitive
-edMI                     = edMultilineInsensitive
-edBS                     = edBlockSensitive
-edBI                     = edBlockInsensitive
-edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
-edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
-edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
-edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
-ed_                      = ed' fn_cast   Nothing
-
-sr_cast :: Q Exp
-sr_cast = [|\x -> x :: SearchReplace RE B.ByteString|]
-
-fn_cast :: Q Exp
-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE B.ByteString|]
diff --git a/Text/RE/Internal/SearchReplace/PCRE/ByteString/Lazy.hs b/Text/RE/Internal/SearchReplace/PCRE/ByteString/Lazy.hs
deleted file mode 100644
--- a/Text/RE/Internal/SearchReplace/PCRE/ByteString/Lazy.hs
+++ /dev/null
@@ -1,58 +0,0 @@
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-
-module Text.RE.Internal.SearchReplace.PCRE.ByteString.Lazy
-  ( ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_
-  ) where
-
-import qualified Data.ByteString.Lazy.Char8    as LBS
-import           Language.Haskell.TH
-import           Language.Haskell.TH.Quote
-import           Text.RE.PCRE.RE
-import           Text.RE.Internal.SearchReplace.PCREEdPrime
-import           Text.RE.SearchReplace
-import           Text.RE.Types.REOptions
-
-
--- | the @[ed| ... /// ... |]@ quasi quoters
-ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_ :: QuasiQuoter
-
-ed                       = ed' sr_cast $ Just minBound
-edMS                     = edMultilineSensitive
-edMI                     = edMultilineInsensitive
-edBS                     = edBlockSensitive
-edBI                     = edBlockInsensitive
-edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
-edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
-edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
-edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
-ed_                      = ed' fn_cast   Nothing
-
-sr_cast :: Q Exp
-sr_cast = [|\x -> x :: SearchReplace RE LBS.ByteString|]
-
-fn_cast :: Q Exp
-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE LBS.ByteString|]
diff --git a/Text/RE/Internal/SearchReplace/PCRE/Sequence.hs b/Text/RE/Internal/SearchReplace/PCRE/Sequence.hs
deleted file mode 100644
--- a/Text/RE/Internal/SearchReplace/PCRE/Sequence.hs
+++ /dev/null
@@ -1,58 +0,0 @@
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-
-module Text.RE.Internal.SearchReplace.PCRE.Sequence
-  ( ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_
-  ) where
-
-import qualified Data.Sequence                 as S
-import           Language.Haskell.TH
-import           Language.Haskell.TH.Quote
-import           Text.RE.PCRE.RE
-import           Text.RE.Internal.SearchReplace.PCREEdPrime
-import           Text.RE.SearchReplace
-import           Text.RE.Types.REOptions
-
-
--- | the @[ed| ... /// ... |]@ quasi quoters
-ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_ :: QuasiQuoter
-
-ed                       = ed' sr_cast $ Just minBound
-edMS                     = edMultilineSensitive
-edMI                     = edMultilineInsensitive
-edBS                     = edBlockSensitive
-edBI                     = edBlockInsensitive
-edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
-edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
-edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
-edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
-ed_                      = ed' fn_cast   Nothing
-
-sr_cast :: Q Exp
-sr_cast = [|\x -> x :: SearchReplace RE (S.Seq Char)|]
-
-fn_cast :: Q Exp
-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE (S.Seq Char)|]
diff --git a/Text/RE/Internal/SearchReplace/PCRE/String.hs b/Text/RE/Internal/SearchReplace/PCRE/String.hs
deleted file mode 100644
--- a/Text/RE/Internal/SearchReplace/PCRE/String.hs
+++ /dev/null
@@ -1,58 +0,0 @@
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-
-module Text.RE.Internal.SearchReplace.PCRE.String
-  ( ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_
-  ) where
-
-
-import           Language.Haskell.TH
-import           Language.Haskell.TH.Quote
-import           Text.RE.PCRE.RE
-import           Text.RE.Internal.SearchReplace.PCREEdPrime
-import           Text.RE.SearchReplace
-import           Text.RE.Types.REOptions
-
-
--- | the @[ed| ... /// ... |]@ quasi quoters
-ed
-  , edMS
-  , edMI
-  , edBS
-  , edBI
-  , edMultilineSensitive
-  , edMultilineInsensitive
-  , edBlockSensitive
-  , edBlockInsensitive
-  , ed_ :: QuasiQuoter
-
-ed                       = ed' sr_cast $ Just minBound
-edMS                     = edMultilineSensitive
-edMI                     = edMultilineInsensitive
-edBS                     = edBlockSensitive
-edBI                     = edBlockInsensitive
-edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
-edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
-edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
-edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
-ed_                      = ed' fn_cast   Nothing
-
-sr_cast :: Q Exp
-sr_cast = [|\x -> x :: SearchReplace RE String|]
-
-fn_cast :: Q Exp
-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE String|]
diff --git a/Text/RE/Internal/SearchReplace/PCREEdPrime.hs b/Text/RE/Internal/SearchReplace/PCREEdPrime.hs
deleted file mode 100644
--- a/Text/RE/Internal/SearchReplace/PCREEdPrime.hs
+++ /dev/null
@@ -1,63 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude          #-}
-{-# LANGUAGE FlexibleContexts           #-}
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-
-module Text.RE.Internal.SearchReplace.PCREEdPrime
-  ( ed'
-  ) where
-
-import           Language.Haskell.TH
-import           Language.Haskell.TH.Quote
-import           Prelude.Compat
-import           Text.RE.Internal.SearchReplace
-import           Text.RE.Internal.QQ
-import           Text.RE.PCRE.RE
-import           Text.RE.SearchReplace
-import           Text.RE.Types.IsRegex
-import           Text.RE.Types.REOptions
-import           Text.RE.Types.Replace
-import           Text.Regex.PCRE
-
-
--- | construct a quasi quoter from a casting function and @Just sro@
--- if the options are known, otherwise a function take takes the
--- 'SimpleREOptions' and constructs the 'SearchReplace' template
-ed' :: Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
-ed' qe mb = case mb of
-  Nothing  ->
-    (qq0 "ed'")
-      { quoteExp = parse minBound $ \rs -> AppE <$> qe <*> [|flip unsafe_compile_sr rs|]
-      }
-  Just sro ->
-    (qq0 "ed'")
-      { quoteExp = parse sro $ \rs -> AppE <$> qe <*> [|unsafe_compile_sr_simple sro rs|]
-      }
-  where
-    parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp
-    parse sro mk ts = either error (\_->mk ts) ei
-      where
-        ei :: Either String (SearchReplace RE String)
-        ei = compileSearchReplace_ id (compileRegexWith sro) ts
-
-unsafe_compile_sr_simple :: IsRegex RE s
-                         => SimpleREOptions
-                         -> String
-                         -> SearchReplace RE s
-unsafe_compile_sr_simple sro =
-    unsafe_compile_sr $ unpackSimpleREOptions sro
-
-unsafe_compile_sr :: ( IsOption o RE CompOption ExecOption
-                              , IsRegex RE s
-                              )
-                           => o
-                           -> String
-                           -> SearchReplace RE s
-unsafe_compile_sr os =
-    unsafeCompileSearchReplace_ packR $ compileRegexWithOptions os
diff --git a/Text/RE/PCRE.hs b/Text/RE/PCRE.hs
--- a/Text/RE/PCRE.hs
+++ b/Text/RE/PCRE.hs
@@ -44,9 +44,9 @@
   , escape
   , escapeWith
   , escapeREString
-  , module Text.RE.PCRE.RE
+  , module Text.RE.ZeInternals.PCRE
   -- * The [ed| ... |] quasi quoters
-  , module Text.RE.Internal.SearchReplace.PCRE
+  , module Text.RE.ZeInternals.SearchReplace.PCRE
   -- * The Operator Instances
   -- $instances
   , module Text.RE.PCRE.ByteString
@@ -59,17 +59,16 @@
 
 import qualified Text.Regex.Base                          as B
 import           Text.RE
-import           Text.RE.Internal.AddCaptureNames
-import           Text.RE.Internal.SearchReplace.PCRE
-import           Text.RE.PCRE.RE
+import           Text.RE.ZeInternals.AddCaptureNames
+import           Text.RE.ZeInternals.SearchReplace.PCRE
+import           Text.RE.ZeInternals.PCRE
 import qualified Text.Regex.PCRE                          as PCRE
 import           Text.RE.PCRE.ByteString()
 import           Text.RE.PCRE.ByteString.Lazy()
 import           Text.RE.PCRE.Sequence()
 import           Text.RE.PCRE.String()
-import           Text.RE.SearchReplace
-import           Text.RE.Types.IsRegex
-import           Text.RE.Types.REOptions
+import           Text.RE.IsRegex
+import           Text.RE.REOptions
 
 
 -- | find all matches in text; e.g., to count the number of naturals in s:
@@ -128,7 +127,7 @@
 --
 -- * "Text.RE.PCRE.ByteString"
 -- * "Text.RE.PCRE.ByteString.Lazy"
--- * "Text.RE.PCRE.RE"
+-- * "Text.RE.ZeInternals.PCRE"
 -- * "Text.RE.PCRE.Sequence"
 -- * "Text.RE.PCRE.String"
 
diff --git a/Text/RE/PCRE/ByteString.hs b/Text/RE/PCRE/ByteString.hs
--- a/Text/RE/PCRE/ByteString.hs
+++ b/Text/RE/PCRE/ByteString.hs
@@ -44,8 +44,8 @@
   , escape
   , escapeWith
   , escapeREString
-  , module Text.RE.PCRE.RE
-  , module Text.RE.Internal.SearchReplace.PCRE.ByteString
+  , module Text.RE.ZeInternals.PCRE
+  , module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString
   ) where
 
 import           Prelude.Compat
@@ -53,13 +53,12 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
-import           Text.RE.Internal.AddCaptureNames
-import           Text.RE.Internal.SearchReplace.PCRE.ByteString
-import           Text.RE.SearchReplace
-import           Text.RE.Types.IsRegex
-import           Text.RE.Types.REOptions
-import           Text.RE.Types.Replace
-import           Text.RE.PCRE.RE
+import           Text.RE.ZeInternals.AddCaptureNames
+import           Text.RE.ZeInternals.SearchReplace.PCRE.ByteString
+import           Text.RE.IsRegex
+import           Text.RE.REOptions
+import           Text.RE.Replace
+import           Text.RE.ZeInternals.PCRE
 import qualified Text.Regex.PCRE               as PCRE
 
 
diff --git a/Text/RE/PCRE/ByteString/Lazy.hs b/Text/RE/PCRE/ByteString/Lazy.hs
--- a/Text/RE/PCRE/ByteString/Lazy.hs
+++ b/Text/RE/PCRE/ByteString/Lazy.hs
@@ -44,8 +44,8 @@
   , escape
   , escapeWith
   , escapeREString
-  , module Text.RE.PCRE.RE
-  , module Text.RE.Internal.SearchReplace.PCRE.ByteString.Lazy
+  , module Text.RE.ZeInternals.PCRE
+  , module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy
   ) where
 
 import           Prelude.Compat
@@ -53,13 +53,12 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
-import           Text.RE.Internal.AddCaptureNames
-import           Text.RE.Internal.SearchReplace.PCRE.ByteString.Lazy
-import           Text.RE.SearchReplace
-import           Text.RE.Types.IsRegex
-import           Text.RE.Types.REOptions
-import           Text.RE.Types.Replace
-import           Text.RE.PCRE.RE
+import           Text.RE.ZeInternals.AddCaptureNames
+import           Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy
+import           Text.RE.IsRegex
+import           Text.RE.REOptions
+import           Text.RE.Replace
+import           Text.RE.ZeInternals.PCRE
 import qualified Text.Regex.PCRE               as PCRE
 
 
diff --git a/Text/RE/PCRE/RE.hs b/Text/RE/PCRE/RE.hs
deleted file mode 100644
--- a/Text/RE/PCRE/RE.hs
+++ /dev/null
@@ -1,412 +0,0 @@
-{-# LANGUAGE NoImplicitPrelude          #-}
-{-# LANGUAGE RecordWildCards            #-}
-{-# LANGUAGE MultiParamTypeClasses      #-}
-{-# LANGUAGE TypeSynonymInstances       #-}
-{-# LANGUAGE FlexibleInstances          #-}
-{-# LANGUAGE FlexibleContexts           #-}
-{-# LANGUAGE CPP                        #-}
-#if __GLASGOW_HASKELL__ >= 800
-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
-{-# LANGUAGE TemplateHaskellQuotes      #-}
-#else
-{-# LANGUAGE QuasiQuotes                #-}
-{-# LANGUAGE TemplateHaskell            #-}
-#endif
-{-# OPTIONS_GHC -fno-warn-orphans       #-}
-
-module Text.RE.PCRE.RE
-  ( -- * About
-    -- $about
-
-    -- * RE Type
-    RE
-  , regexType
-  , reOptions
-  , reSource
-  , reCaptureNames
-  , reRegex
-  -- * REOptions Type
-  , REOptions
-  , defaultREOptions
-  , noPreludeREOptions
-  -- * Compiling Regular Expressions
-  , compileRegex
-  , compileRegexWith
-  , compileRegexWithOptions
-  -- * Compiling Search-Replace Templates
-  , compileSearchReplace
-  , compileSearchReplaceWith
-  , compileSearchReplaceWithREOptions
-  -- * Escaping String
-  , escape
-  , escapeWith
-  , escapeWithOptions
-  , escapeREString
-  -- * Macros Standard Environment
-  , prelude
-  , preludeEnv
-  , preludeTestsFailing
-  , preludeTable
-  , preludeSummary
-  , preludeSources
-  , preludeSource
-  , unpackSimpleREOptions
-  -- * The Quasi Quoters
-  , re
-  , reMS
-  , reMI
-  , reBS
-  , reBI
-  , reMultilineSensitive
-  , reMultilineInsensitive
-  , reBlockSensitive
-  , reBlockInsensitive
-  , re_
-  , cp
-  ) where
-
-import           Data.Bits
-import           Data.Functor.Identity
-import           Language.Haskell.TH
-import           Language.Haskell.TH.Quote
-import           Prelude.Compat
-import           Text.RE.Internal.EscapeREString
-import           Text.RE.Internal.NamedCaptures
-import           Text.RE.Internal.PreludeMacros
-import           Text.RE.Internal.QQ
-import           Text.RE.Internal.SearchReplace
-import           Text.RE.SearchReplace
-import           Text.RE.TestBench
-import           Text.RE.Types.CaptureID
-import           Text.RE.Types.IsRegex
-import           Text.RE.Types.REOptions
-import           Text.RE.Types.Replace
-import           Text.Regex.PCRE
-
-
--- | the RE type for this back end representing a well-formed, compiled
--- RE
-data RE =
-  RE
-    { _re_options :: !REOptions
-    , _re_source  :: !String
-    , _re_cnames  :: !CaptureNames
-    , _re_regex   :: !Regex
-    }
-
--- | some functions in the "Text.RE.TestBench" need the back end to
--- be passed dynamically as a 'RegexType' parameters: use 'regexType'
--- fpr this backend
-regexType :: RegexType
-regexType =
-  mkPCRE $ \txt env md -> txt =~ mdRegexSource regexType ExclCaptures env md
-
--- | extract the 'REOptions' from the @RE@
-reOptions :: RE -> REOptions
-reOptions = _re_options
-
--- | extract the RE source string from the @RE@
-reSource :: RE -> String
-reSource = _re_source
-
--- | extract the 'CaptureNames' from the @RE@
-reCaptureNames :: RE -> CaptureNames
-reCaptureNames = _re_cnames
-
--- | extract the back end compiled 'Regex' type from the @RE@
-reRegex  :: RE -> Regex
-reRegex = _re_regex
-
-
-------------------------------------------------------------------------
--- REOptions
-------------------------------------------------------------------------
-
--- | and the REOptions for this back end (see "Text.RE.Types.REOptions"
--- for details)
-type REOptions = REOptions_ RE CompOption ExecOption
-
-instance IsOption SimpleREOptions RE CompOption ExecOption where
-  makeREOptions    = unpackSimpleREOptions
-
-instance IsOption (Macros RE) RE CompOption ExecOption where
-  makeREOptions ms = REOptions ms def_comp_option def_exec_option
-
-instance IsOption CompOption  RE CompOption ExecOption where
-  makeREOptions co = REOptions prelude co def_exec_option
-
-instance IsOption ExecOption  RE CompOption ExecOption where
-  makeREOptions eo = REOptions prelude def_comp_option eo
-
-instance IsOption REOptions     RE CompOption ExecOption where
-  makeREOptions    = id
-
-instance IsOption ()          RE CompOption ExecOption where
-  makeREOptions _  = unpackSimpleREOptions minBound
-
--- | the default 'REOptions'
-defaultREOptions :: REOptions
-defaultREOptions = makeREOptions (minBound::SimpleREOptions)
-
--- | the default 'REOptions' but with no RE macros defined
-noPreludeREOptions :: REOptions
-noPreludeREOptions = defaultREOptions { optionsMacs = emptyMacros }
-
--- | convert a universal 'SimpleReOptions' into the 'REOptions' used
--- by this back end
-unpackSimpleREOptions :: SimpleREOptions -> REOptions
-unpackSimpleREOptions sro =
-  REOptions
-    { optionsMacs = prelude
-    , optionsComp = comp
-    , optionsExec = defaultExecOpt
-    }
-  where
-    comp =
-      wiggle ml compMultiline $
-      wiggle ci compCaseless
-        defaultCompOpt
-
-    wiggle True  m v = v .|.            m
-    wiggle False m v = v .&. complement m
-
-    (ml,ci) = case sro of
-        MultilineSensitive    -> (,) True  False
-        MultilineInsensitive  -> (,) True  True
-        BlockSensitive        -> (,) False False
-        BlockInsensitive      -> (,) False True
-
-
-------------------------------------------------------------------------
--- Compiling Regular Expressions
-------------------------------------------------------------------------
-
--- | compile a 'String' into a 'RE' with the default options,
--- generating an error if the RE is not well formed
-compileRegex :: (Functor m,Monad m) => String -> m RE
-compileRegex = compileRegexWithOptions ()
-
--- | compile a 'String' into a 'RE' using the given @SimpleREOptions@,
--- generating an error if the RE is not well formed
-compileRegexWith :: (Functor m,Monad m) => SimpleREOptions -> String -> m RE
-compileRegexWith = compileRegexWithOptions
-
--- | compile a 'String' into a 'RE' using the given @SimpleREOptions@,
--- generating an error if the RE is not well formed
-compileRegexWithOptions :: ( IsOption o RE CompOption ExecOption
-                           , Functor m
-                           , Monad   m
-                           )
-                        => o
-                        -> String
-                        -> m RE
-compileRegexWithOptions = compileRegex_ . makeREOptions
-
-
-------------------------------------------------------------------------
--- Compiling Search Replace Templates
-------------------------------------------------------------------------
-
--- | compile a SearchReplace template generating errors if the RE or
--- the template are not well formed -- all capture references being checked
-compileSearchReplace :: (Monad m,Functor m,IsRegex RE s)
-                     => String
-                     -> String
-                     -> m (SearchReplace RE s)
-compileSearchReplace = compileSearchReplaceWith minBound
-
--- | compile a SearchReplace template, with simple options, generating
--- errors if the RE or the template are not well formed -- all capture
--- references being checked
-compileSearchReplaceWith :: (Monad m,Functor m,IsRegex RE s)
-                         => SimpleREOptions
-                         -> String
-                         -> String
-                         -> m (SearchReplace RE s)
-compileSearchReplaceWith sro = compileSearchAndReplace_ packR $ compileRegexWith sro
-
--- | compile a SearchReplace template, with general options, generating
--- errors if the RE or the template are not well formed -- all capture
--- references being checked
-compileSearchReplaceWithREOptions :: (Monad m,Functor m,IsRegex RE s)
-                                  => REOptions
-                                  -> String
-                                  -> String
-                                  -> m (SearchReplace RE s)
-compileSearchReplaceWithREOptions os = compileSearchAndReplace_ packR $ compileRegexWithOptions os
-
-
-------------------------------------------------------------------------
--- Escaping Strings
-------------------------------------------------------------------------
-
--- | convert a string into a RE that matches that string, and apply it
--- to an argument continuation function to make up the RE string to be
--- compiled
-escape :: (Functor m,Monad m)
-       => (String->String)
-       -> String
-       -> m RE
-escape = escapeWith minBound
-
--- | convert a string into a RE that matches that string, and apply it
--- to an argument continuation function to make up the RE string to be
--- compiled with the default options
-escapeWith :: (Functor m,Monad m)
-           => SimpleREOptions
-           -> (String->String)
-           -> String
-           -> m RE
-escapeWith = escapeWithOptions
-
--- | convert a string into a RE that matches that string, and apply it
--- to an argument continuation function to make up the RE string to be
--- compiled the given options
-escapeWithOptions :: ( IsOption o RE CompOption ExecOption
-                     , Functor m
-                     , Monad m
-                     )
-                  => o
-                  -> (String->String)
-                  -> String
-                  -> m RE
-escapeWithOptions o f = compileRegexWithOptions o . f . escapeREString
-
-
-------------------------------------------------------------------------
--- Macro Standard Environment
-------------------------------------------------------------------------
-
-prelude :: Macros RE
-prelude = runIdentity $ preludeMacros mk regexType ExclCaptures
-  where
-    mk = Identity . unsafeCompileRegex_ noPreludeREOptions
-
-preludeTestsFailing :: [MacroID]
-preludeTestsFailing = badMacros preludeEnv
-
-preludeEnv :: MacroEnv
-preludeEnv = preludeMacroEnv regexType
-
-preludeTable :: String
-preludeTable = preludeMacroTable regexType
-
-preludeSummary :: PreludeMacro -> String
-preludeSummary = preludeMacroSummary regexType
-
-preludeSources :: String
-preludeSources = preludeMacroSources regexType
-
-preludeSource :: PreludeMacro -> String
-preludeSource = preludeMacroSource regexType
-
-
-------------------------------------------------------------------------
--- Quasi Quoters
-------------------------------------------------------------------------
-
--- | the @[re| ... |]@ and @[ed| ... /// ... |]@ quasi quoters
-re
-  , reMS
-  , reMI
-  , reBS
-  , reBI
-  , reMultilineSensitive
-  , reMultilineInsensitive
-  , reBlockSensitive
-  , reBlockInsensitive
-  , re_ :: QuasiQuoter
-
-re                       = re' $ Just minBound
-reMS                     = reMultilineSensitive
-reMI                     = reMultilineInsensitive
-reBS                     = reBlockSensitive
-reBI                     = reBlockInsensitive
-reMultilineSensitive     = re' $ Just  MultilineSensitive
-reMultilineInsensitive   = re' $ Just  MultilineInsensitive
-reBlockSensitive         = re' $ Just  BlockSensitive
-reBlockInsensitive       = re' $ Just  BlockInsensitive
-re_                      = re'   Nothing
-
-
-------------------------------------------------------------------------
--- re Helpers
-------------------------------------------------------------------------
-
-re' :: Maybe SimpleREOptions -> QuasiQuoter
-re' mb = case mb of
-  Nothing  ->
-    (qq0 "re'")
-      { quoteExp = parse minBound (\rs->[|flip unsafeCompileRegex rs|])
-      }
-  Just sro ->
-    (qq0 "re'")
-      { quoteExp = parse sro (\rs->[|unsafeCompileRegexSimple sro rs|])
-      }
-  where
-    parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp
-    parse sro mk rs = either error (\_->mk rs) $ compileRegex_ os rs
-      where
-        os = unpackSimpleREOptions sro
-
-unsafeCompileRegexSimple :: SimpleREOptions -> String -> RE
-unsafeCompileRegexSimple sro re_s = unsafeCompileRegex os re_s
-  where
-    os = unpackSimpleREOptions sro
-
-unsafeCompileRegex :: IsOption o RE CompOption ExecOption
-                   => o
-                   -> String
-                   -> RE
-unsafeCompileRegex = unsafeCompileRegex_ . makeREOptions
-
-unsafeCompileRegex_ :: REOptions -> String -> RE
-unsafeCompileRegex_ os = either oops id . compileRegexWithOptions os
-  where
-    oops = error . ("unsafeCompileRegex: " ++)
-
-compileRegex' :: (Functor m,Monad m)
-              => REOptions
-              -> String
-              -> m (CaptureNames,Regex)
-compileRegex' REOptions{..} s0 = do
-    ((_,cnms),s2) <- either fail return $ extractNamedCaptures s1
-    (,) cnms <$> makeRegexOptsM optionsComp optionsExec s2
-  where
-    s1 = expandMacros reSource optionsMacs s0
-
-compileRegex_ :: ( Functor m , Monad m )
-              => REOptions
-              -> String
-              -> m RE
-compileRegex_ os re_s = uncurry mk <$> compileRegex' os re_s
-  where
-    mk cnms rex =
-      RE
-        { _re_options = os
-        , _re_source  = re_s
-        , _re_cnames  = cnms
-        , _re_regex   = rex
-        }
-
-
-------------------------------------------------------------------------
--- Helpers
-------------------------------------------------------------------------
-
-def_comp_option :: CompOption
-def_comp_option = optionsComp defaultREOptions
-
-def_exec_option :: ExecOption
-def_exec_option = optionsExec defaultREOptions
-
-
-------------------------------------------------------------------------
--- Haddock Sections
-------------------------------------------------------------------------
-
--- $about
---
--- This module provides the regex PCRE back end. Most of the functions that
--- you will need for day to day use are provided by the primary API modules
--- (e.g., "Text.RE.PCRE.ByteString").
diff --git a/Text/RE/PCRE/Sequence.hs b/Text/RE/PCRE/Sequence.hs
--- a/Text/RE/PCRE/Sequence.hs
+++ b/Text/RE/PCRE/Sequence.hs
@@ -44,8 +44,8 @@
   , escape
   , escapeWith
   , escapeREString
-  , module Text.RE.PCRE.RE
-  , module Text.RE.Internal.SearchReplace.PCRE.Sequence
+  , module Text.RE.ZeInternals.PCRE
+  , module Text.RE.ZeInternals.SearchReplace.PCRE.Sequence
   ) where
 
 import           Prelude.Compat
@@ -53,13 +53,12 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
-import           Text.RE.Internal.AddCaptureNames
-import           Text.RE.Internal.SearchReplace.PCRE.Sequence
-import           Text.RE.SearchReplace
-import           Text.RE.Types.IsRegex
-import           Text.RE.Types.REOptions
-import           Text.RE.Types.Replace
-import           Text.RE.PCRE.RE
+import           Text.RE.ZeInternals.AddCaptureNames
+import           Text.RE.ZeInternals.SearchReplace.PCRE.Sequence
+import           Text.RE.IsRegex
+import           Text.RE.REOptions
+import           Text.RE.Replace
+import           Text.RE.ZeInternals.PCRE
 import qualified Text.Regex.PCRE               as PCRE
 
 
diff --git a/Text/RE/PCRE/String.hs b/Text/RE/PCRE/String.hs
--- a/Text/RE/PCRE/String.hs
+++ b/Text/RE/PCRE/String.hs
@@ -44,8 +44,8 @@
   , escape
   , escapeWith
   , escapeREString
-  , module Text.RE.PCRE.RE
-  , module Text.RE.Internal.SearchReplace.PCRE.String
+  , module Text.RE.ZeInternals.PCRE
+  , module Text.RE.ZeInternals.SearchReplace.PCRE.String
   ) where
 
 import           Prelude.Compat
@@ -53,13 +53,12 @@
 import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
-import           Text.RE.Internal.AddCaptureNames
-import           Text.RE.Internal.SearchReplace.PCRE.String
-import           Text.RE.SearchReplace
-import           Text.RE.Types.IsRegex
-import           Text.RE.Types.REOptions
-import           Text.RE.Types.Replace
-import           Text.RE.PCRE.RE
+import           Text.RE.ZeInternals.AddCaptureNames
+import           Text.RE.ZeInternals.SearchReplace.PCRE.String
+import           Text.RE.IsRegex
+import           Text.RE.REOptions
+import           Text.RE.Replace
+import           Text.RE.ZeInternals.PCRE
 import qualified Text.Regex.PCRE               as PCRE
 
 
diff --git a/Text/RE/ZeInternals/PCRE.hs b/Text/RE/ZeInternals/PCRE.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/PCRE.hs
@@ -0,0 +1,411 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
+{-# LANGUAGE RecordWildCards            #-}
+{-# LANGUAGE MultiParamTypeClasses      #-}
+{-# LANGUAGE TypeSynonymInstances       #-}
+{-# LANGUAGE FlexibleInstances          #-}
+{-# LANGUAGE FlexibleContexts           #-}
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+{-# OPTIONS_GHC -fno-warn-orphans       #-}
+
+module Text.RE.ZeInternals.PCRE
+  ( -- * About
+    -- $about
+
+    -- * RE Type
+    RE
+  , regexType
+  , reOptions
+  , reSource
+  , reCaptureNames
+  , reRegex
+  -- * REOptions Type
+  , REOptions
+  , defaultREOptions
+  , noPreludeREOptions
+  -- * Compiling Regular Expressions
+  , compileRegex
+  , compileRegexWith
+  , compileRegexWithOptions
+  -- * Compiling Search-Replace Templates
+  , compileSearchReplace
+  , compileSearchReplaceWith
+  , compileSearchReplaceWithREOptions
+  -- * Escaping String
+  , escape
+  , escapeWith
+  , escapeWithOptions
+  , escapeREString
+  -- * Macros Standard Environment
+  , prelude
+  , preludeEnv
+  , preludeTestsFailing
+  , preludeTable
+  , preludeSummary
+  , preludeSources
+  , preludeSource
+  , unpackSimpleREOptions
+  -- * The Quasi Quoters
+  , re
+  , reMS
+  , reMI
+  , reBS
+  , reBI
+  , reMultilineSensitive
+  , reMultilineInsensitive
+  , reBlockSensitive
+  , reBlockInsensitive
+  , re_
+  , cp
+  ) where
+
+import           Data.Bits
+import           Data.Functor.Identity
+import           Language.Haskell.TH
+import           Language.Haskell.TH.Quote
+import           Prelude.Compat
+import           Text.RE.IsRegex
+import           Text.RE.REOptions
+import           Text.RE.ZeInternals.EscapeREString
+import           Text.RE.ZeInternals.NamedCaptures
+import           Text.RE.ZeInternals.PreludeMacros
+import           Text.RE.ZeInternals.Replace
+import           Text.RE.ZeInternals.QQ
+import           Text.RE.ZeInternals.SearchReplace
+import           Text.RE.ZeInternals.TestBench
+import           Text.RE.ZeInternals.Types.CaptureID
+import           Text.Regex.PCRE
+
+
+-- | the RE type for this back end representing a well-formed, compiled
+-- RE
+data RE =
+  RE
+    { _re_options :: !REOptions
+    , _re_source  :: !String
+    , _re_cnames  :: !CaptureNames
+    , _re_regex   :: !Regex
+    }
+
+-- | some functions in the "Text.RE.TestBench" need the back end to
+-- be passed dynamically as a 'RegexType' parameters: use 'regexType'
+-- fpr this backend
+regexType :: RegexType
+regexType =
+  mkPCRE $ \txt env md -> txt =~ mdRegexSource regexType ExclCaptures env md
+
+-- | extract the 'REOptions' from the @RE@
+reOptions :: RE -> REOptions
+reOptions = _re_options
+
+-- | extract the RE source string from the @RE@
+reSource :: RE -> String
+reSource = _re_source
+
+-- | extract the 'CaptureNames' from the @RE@
+reCaptureNames :: RE -> CaptureNames
+reCaptureNames = _re_cnames
+
+-- | extract the back end compiled 'Regex' type from the @RE@
+reRegex  :: RE -> Regex
+reRegex = _re_regex
+
+
+------------------------------------------------------------------------
+-- REOptions
+------------------------------------------------------------------------
+
+-- | and the REOptions for this back end (see "Text.RE.REOptions"
+-- for details)
+type REOptions = REOptions_ RE CompOption ExecOption
+
+instance IsOption SimpleREOptions RE CompOption ExecOption where
+  makeREOptions    = unpackSimpleREOptions
+
+instance IsOption (Macros RE) RE CompOption ExecOption where
+  makeREOptions ms = REOptions ms def_comp_option def_exec_option
+
+instance IsOption CompOption  RE CompOption ExecOption where
+  makeREOptions co = REOptions prelude co def_exec_option
+
+instance IsOption ExecOption  RE CompOption ExecOption where
+  makeREOptions eo = REOptions prelude def_comp_option eo
+
+instance IsOption REOptions     RE CompOption ExecOption where
+  makeREOptions    = id
+
+instance IsOption ()          RE CompOption ExecOption where
+  makeREOptions _  = unpackSimpleREOptions minBound
+
+-- | the default 'REOptions'
+defaultREOptions :: REOptions
+defaultREOptions = makeREOptions (minBound::SimpleREOptions)
+
+-- | the default 'REOptions' but with no RE macros defined
+noPreludeREOptions :: REOptions
+noPreludeREOptions = defaultREOptions { optionsMacs = emptyMacros }
+
+-- | convert a universal 'SimpleReOptions' into the 'REOptions' used
+-- by this back end
+unpackSimpleREOptions :: SimpleREOptions -> REOptions
+unpackSimpleREOptions sro =
+  REOptions
+    { optionsMacs = prelude
+    , optionsComp = comp
+    , optionsExec = defaultExecOpt
+    }
+  where
+    comp =
+      wiggle ml compMultiline $
+      wiggle ci compCaseless
+        defaultCompOpt
+
+    wiggle True  m v = v .|.            m
+    wiggle False m v = v .&. complement m
+
+    (ml,ci) = case sro of
+        MultilineSensitive    -> (,) True  False
+        MultilineInsensitive  -> (,) True  True
+        BlockSensitive        -> (,) False False
+        BlockInsensitive      -> (,) False True
+
+
+------------------------------------------------------------------------
+-- Compiling Regular Expressions
+------------------------------------------------------------------------
+
+-- | compile a 'String' into a 'RE' with the default options,
+-- generating an error if the RE is not well formed
+compileRegex :: (Functor m,Monad m) => String -> m RE
+compileRegex = compileRegexWithOptions ()
+
+-- | compile a 'String' into a 'RE' using the given @SimpleREOptions@,
+-- generating an error if the RE is not well formed
+compileRegexWith :: (Functor m,Monad m) => SimpleREOptions -> String -> m RE
+compileRegexWith = compileRegexWithOptions
+
+-- | compile a 'String' into a 'RE' using the given @SimpleREOptions@,
+-- generating an error if the RE is not well formed
+compileRegexWithOptions :: ( IsOption o RE CompOption ExecOption
+                           , Functor m
+                           , Monad   m
+                           )
+                        => o
+                        -> String
+                        -> m RE
+compileRegexWithOptions = compileRegex_ . makeREOptions
+
+
+------------------------------------------------------------------------
+-- Compiling Search Replace Templates
+------------------------------------------------------------------------
+
+-- | compile a SearchReplace template generating errors if the RE or
+-- the template are not well formed -- all capture references being checked
+compileSearchReplace :: (Monad m,Functor m,IsRegex RE s)
+                     => String
+                     -> String
+                     -> m (SearchReplace RE s)
+compileSearchReplace = compileSearchReplaceWith minBound
+
+-- | compile a SearchReplace template, with simple options, generating
+-- errors if the RE or the template are not well formed -- all capture
+-- references being checked
+compileSearchReplaceWith :: (Monad m,Functor m,IsRegex RE s)
+                         => SimpleREOptions
+                         -> String
+                         -> String
+                         -> m (SearchReplace RE s)
+compileSearchReplaceWith sro = compileSearchAndReplace_ packR $ compileRegexWith sro
+
+-- | compile a SearchReplace template, with general options, generating
+-- errors if the RE or the template are not well formed -- all capture
+-- references being checked
+compileSearchReplaceWithREOptions :: (Monad m,Functor m,IsRegex RE s)
+                                  => REOptions
+                                  -> String
+                                  -> String
+                                  -> m (SearchReplace RE s)
+compileSearchReplaceWithREOptions os = compileSearchAndReplace_ packR $ compileRegexWithOptions os
+
+
+------------------------------------------------------------------------
+-- Escaping Strings
+------------------------------------------------------------------------
+
+-- | convert a string into a RE that matches that string, and apply it
+-- to an argument continuation function to make up the RE string to be
+-- compiled
+escape :: (Functor m,Monad m)
+       => (String->String)
+       -> String
+       -> m RE
+escape = escapeWith minBound
+
+-- | convert a string into a RE that matches that string, and apply it
+-- to an argument continuation function to make up the RE string to be
+-- compiled with the default options
+escapeWith :: (Functor m,Monad m)
+           => SimpleREOptions
+           -> (String->String)
+           -> String
+           -> m RE
+escapeWith = escapeWithOptions
+
+-- | convert a string into a RE that matches that string, and apply it
+-- to an argument continuation function to make up the RE string to be
+-- compiled the given options
+escapeWithOptions :: ( IsOption o RE CompOption ExecOption
+                     , Functor m
+                     , Monad m
+                     )
+                  => o
+                  -> (String->String)
+                  -> String
+                  -> m RE
+escapeWithOptions o f = compileRegexWithOptions o . f . escapeREString
+
+
+------------------------------------------------------------------------
+-- Macro Standard Environment
+------------------------------------------------------------------------
+
+prelude :: Macros RE
+prelude = runIdentity $ preludeMacros mk regexType ExclCaptures
+  where
+    mk = Identity . unsafeCompileRegex_ noPreludeREOptions
+
+preludeTestsFailing :: [MacroID]
+preludeTestsFailing = badMacros preludeEnv
+
+preludeEnv :: MacroEnv
+preludeEnv = preludeMacroEnv regexType
+
+preludeTable :: String
+preludeTable = preludeMacroTable regexType
+
+preludeSummary :: PreludeMacro -> String
+preludeSummary = preludeMacroSummary regexType
+
+preludeSources :: String
+preludeSources = preludeMacroSources regexType
+
+preludeSource :: PreludeMacro -> String
+preludeSource = preludeMacroSource regexType
+
+
+------------------------------------------------------------------------
+-- Quasi Quoters
+------------------------------------------------------------------------
+
+-- | the @[re| ... |]@ and @[ed| ... /// ... |]@ quasi quoters
+re
+  , reMS
+  , reMI
+  , reBS
+  , reBI
+  , reMultilineSensitive
+  , reMultilineInsensitive
+  , reBlockSensitive
+  , reBlockInsensitive
+  , re_ :: QuasiQuoter
+
+re                       = re' $ Just minBound
+reMS                     = reMultilineSensitive
+reMI                     = reMultilineInsensitive
+reBS                     = reBlockSensitive
+reBI                     = reBlockInsensitive
+reMultilineSensitive     = re' $ Just  MultilineSensitive
+reMultilineInsensitive   = re' $ Just  MultilineInsensitive
+reBlockSensitive         = re' $ Just  BlockSensitive
+reBlockInsensitive       = re' $ Just  BlockInsensitive
+re_                      = re'   Nothing
+
+
+------------------------------------------------------------------------
+-- re Helpers
+------------------------------------------------------------------------
+
+re' :: Maybe SimpleREOptions -> QuasiQuoter
+re' mb = case mb of
+  Nothing  ->
+    (qq0 "re'")
+      { quoteExp = parse minBound (\rs->[|flip unsafeCompileRegex rs|])
+      }
+  Just sro ->
+    (qq0 "re'")
+      { quoteExp = parse sro (\rs->[|unsafeCompileRegexSimple sro rs|])
+      }
+  where
+    parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp
+    parse sro mk rs = either error (\_->mk rs) $ compileRegex_ os rs
+      where
+        os = unpackSimpleREOptions sro
+
+unsafeCompileRegexSimple :: SimpleREOptions -> String -> RE
+unsafeCompileRegexSimple sro re_s = unsafeCompileRegex os re_s
+  where
+    os = unpackSimpleREOptions sro
+
+unsafeCompileRegex :: IsOption o RE CompOption ExecOption
+                   => o
+                   -> String
+                   -> RE
+unsafeCompileRegex = unsafeCompileRegex_ . makeREOptions
+
+unsafeCompileRegex_ :: REOptions -> String -> RE
+unsafeCompileRegex_ os = either oops id . compileRegexWithOptions os
+  where
+    oops = error . ("unsafeCompileRegex: " ++)
+
+compileRegex' :: (Functor m,Monad m)
+              => REOptions
+              -> String
+              -> m (CaptureNames,Regex)
+compileRegex' REOptions{..} s0 = do
+    ((_,cnms),s2) <- either fail return $ extractNamedCaptures s1
+    (,) cnms <$> makeRegexOptsM optionsComp optionsExec s2
+  where
+    s1 = expandMacros reSource optionsMacs s0
+
+compileRegex_ :: ( Functor m , Monad m )
+              => REOptions
+              -> String
+              -> m RE
+compileRegex_ os re_s = uncurry mk <$> compileRegex' os re_s
+  where
+    mk cnms rex =
+      RE
+        { _re_options = os
+        , _re_source  = re_s
+        , _re_cnames  = cnms
+        , _re_regex   = rex
+        }
+
+
+------------------------------------------------------------------------
+-- Helpers
+------------------------------------------------------------------------
+
+def_comp_option :: CompOption
+def_comp_option = optionsComp defaultREOptions
+
+def_exec_option :: ExecOption
+def_exec_option = optionsExec defaultREOptions
+
+
+------------------------------------------------------------------------
+-- Haddock Sections
+------------------------------------------------------------------------
+
+-- $about
+--
+-- This module provides the regex PCRE back end. Most of the functions that
+-- you will need for day to day use are provided by the primary API modules
+-- (e.g., "Text.RE.PCRE.ByteString").
diff --git a/Text/RE/ZeInternals/QQ.hs b/Text/RE/ZeInternals/QQ.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/QQ.hs
@@ -0,0 +1,29 @@
+{-# LANGUAGE DeriveDataTypeable         #-}
+
+module Text.RE.ZeInternals.QQ where
+
+import           Control.Exception
+import           Data.Typeable
+import           Language.Haskell.TH.Quote
+
+
+-- | used to throw an exception reporting an abuse of a quasi quoter
+data QQFailure =
+  QQFailure
+    { _qqf_context   :: String  -- ^ in what context was the quasi quoter used
+    , _qqf_component :: String  -- ^ how was the quasi quoter being abused
+    }
+  deriving (Show,Typeable)
+
+instance Exception QQFailure where
+
+-- | a quasi quoter that can be used in no context (to be extended with
+-- the appropriate quasi quoter parser)
+qq0 :: String -> QuasiQuoter
+qq0 ctx =
+  QuasiQuoter
+    { quoteExp  = const $ throw $ QQFailure ctx "expression"
+    , quotePat  = const $ throw $ QQFailure ctx "pattern"
+    , quoteType = const $ throw $ QQFailure ctx "type"
+    , quoteDec  = const $ throw $ QQFailure ctx "declaration"
+    }
diff --git a/Text/RE/ZeInternals/SearchReplace.hs b/Text/RE/ZeInternals/SearchReplace.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/SearchReplace.hs
@@ -0,0 +1,84 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
+{-# LANGUAGE RecordWildCards            #-}
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+{-# OPTIONS_GHC -fno-warn-orphans       #-}
+
+module Text.RE.ZeInternals.SearchReplace
+  ( unsafeCompileSearchReplace_
+  , compileSearchReplace_
+  , compileSearchAndReplace_
+  ) where
+
+import qualified Data.HashMap.Strict            as HMS
+import           Prelude.Compat
+import           Text.RE.ZeInternals.NamedCaptures
+import           Text.RE.ZeInternals.Replace
+import           Text.RE.ZeInternals.Types.Capture
+import           Text.RE.ZeInternals.Types.CaptureID
+import           Text.RE.ZeInternals.Types.Matches
+import           Text.RE.ZeInternals.Types.SearchReplace
+import qualified Text.Regex.TDFA                as TDFA
+
+
+-- | warapper on 'compileSearchReplace_' that will generate an error
+-- if any compilation errors are found
+unsafeCompileSearchReplace_ :: (String->s)
+                            -> (String->Either String re)
+                            -> String
+                            -> SearchReplace re s
+unsafeCompileSearchReplace_ pk cf = either err id . compileSearchReplace_ pk cf
+  where
+    err msg = error $ "unsafeCompileSearchReplace_: " ++ msg
+
+-- | compile a SearchReplace template generating errors if the RE or
+-- the template are not well formed -- all capture references being checked
+compileSearchReplace_ :: (Monad m,Functor m)
+                      => (String->s)
+                      -> (String->Either String re)
+                      -> String
+                      -> m (SearchReplace re s)
+compileSearchReplace_ pack compile_re sr_tpl = either fail return $ do
+    case mainCaptures $ sr_tpl $=~ "///" of
+      [cap] ->
+        compileSearchAndReplace_ pack compile_re
+                      (capturePrefix cap) (captureSuffix cap)
+      _ -> Left $ "bad search-replace template syntax: " ++ sr_tpl
+
+-- | compile 'SearcgReplace' from two strings containing the RE
+-- and the replacement template
+compileSearchAndReplace_ :: (Monad m,Functor m)
+                         => (String->s)
+                         -> (String->Either String re)
+                         -> String
+                         -> String
+                         -> m (SearchReplace re s)
+compileSearchAndReplace_ pack compile_re re_s tpl = either fail return $ do
+    re           <- compile_re re_s
+    ((n,cnms),_) <- extractNamedCaptures re_s
+    mapM_ (check n cnms) $ templateCaptures id tpl
+    return $ SearchReplace re $ pack tpl
+  where
+    check :: Int -> CaptureNames -> CaptureID -> Either String ()
+    check n cnms cid = case cid of
+      IsCaptureOrdinal co -> check_co n    co
+      IsCaptureName    cn -> check_cn cnms cn
+
+    check_co n (CaptureOrdinal i) = case i <= n of
+      True  -> return ()
+      False -> Left $ "capture ordinal out of range: " ++
+                                      show i ++ " >= " ++ show n
+
+    check_cn cnms cnm = case cnm `HMS.member` cnms of
+      True  -> return ()
+      False -> Left $ "capture name not defined: " ++
+                                      show (getCaptureName cnm)
+
+($=~) :: String -> String -> Matches String
+($=~) = (TDFA.=~)
diff --git a/Text/RE/ZeInternals/SearchReplace/PCRE.hs b/Text/RE/ZeInternals/SearchReplace/PCRE.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/SearchReplace/PCRE.hs
@@ -0,0 +1,54 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+
+module Text.RE.ZeInternals.SearchReplace.PCRE
+  ( ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_
+  ) where
+
+import           Language.Haskell.TH
+import           Language.Haskell.TH.Quote
+import           Prelude.Compat
+import           Text.RE.ZeInternals.SearchReplace.PCREEdPrime
+import           Text.RE.REOptions
+
+
+-- | the @[ed| ... /// ... |]@ quasi quoters
+ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_ :: QuasiQuoter
+
+ed                       = ed' cast $ Just minBound
+edMS                     = edMultilineSensitive
+edMI                     = edMultilineInsensitive
+edBS                     = edBlockSensitive
+edBI                     = edBlockInsensitive
+edMultilineSensitive     = ed' cast $ Just  MultilineSensitive
+edMultilineInsensitive   = ed' cast $ Just  MultilineInsensitive
+edBlockSensitive         = ed' cast $ Just  BlockSensitive
+edBlockInsensitive       = ed' cast $ Just  BlockInsensitive
+ed_                      = ed' cast   Nothing
+
+cast :: Q Exp
+cast = [|id|]
diff --git a/Text/RE/ZeInternals/SearchReplace/PCRE/ByteString.hs b/Text/RE/ZeInternals/SearchReplace/PCRE/ByteString.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/SearchReplace/PCRE/ByteString.hs
@@ -0,0 +1,58 @@
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+
+module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString
+  ( ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_
+  ) where
+
+import qualified Data.ByteString.Char8         as B
+import           Language.Haskell.TH
+import           Language.Haskell.TH.Quote
+import           Text.RE.ZeInternals.PCRE
+import           Text.RE.ZeInternals.SearchReplace.PCREEdPrime
+import           Text.RE.REOptions
+import           Text.RE.ZeInternals.Types.SearchReplace
+
+
+-- | the @[ed| ... /// ... |]@ quasi quoters
+ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_ :: QuasiQuoter
+
+ed                       = ed' sr_cast $ Just minBound
+edMS                     = edMultilineSensitive
+edMI                     = edMultilineInsensitive
+edBS                     = edBlockSensitive
+edBI                     = edBlockInsensitive
+edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
+edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
+edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
+edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
+ed_                      = ed' fn_cast   Nothing
+
+sr_cast :: Q Exp
+sr_cast = [|\x -> x :: SearchReplace RE B.ByteString|]
+
+fn_cast :: Q Exp
+fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE B.ByteString|]
diff --git a/Text/RE/ZeInternals/SearchReplace/PCRE/ByteString/Lazy.hs b/Text/RE/ZeInternals/SearchReplace/PCRE/ByteString/Lazy.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/SearchReplace/PCRE/ByteString/Lazy.hs
@@ -0,0 +1,58 @@
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+
+module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy
+  ( ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_
+  ) where
+
+import qualified Data.ByteString.Lazy.Char8    as LBS
+import           Language.Haskell.TH
+import           Language.Haskell.TH.Quote
+import           Text.RE.ZeInternals.PCRE
+import           Text.RE.ZeInternals.SearchReplace.PCREEdPrime
+import           Text.RE.REOptions
+import           Text.RE.ZeInternals.Types.SearchReplace
+
+
+-- | the @[ed| ... /// ... |]@ quasi quoters
+ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_ :: QuasiQuoter
+
+ed                       = ed' sr_cast $ Just minBound
+edMS                     = edMultilineSensitive
+edMI                     = edMultilineInsensitive
+edBS                     = edBlockSensitive
+edBI                     = edBlockInsensitive
+edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
+edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
+edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
+edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
+ed_                      = ed' fn_cast   Nothing
+
+sr_cast :: Q Exp
+sr_cast = [|\x -> x :: SearchReplace RE LBS.ByteString|]
+
+fn_cast :: Q Exp
+fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE LBS.ByteString|]
diff --git a/Text/RE/ZeInternals/SearchReplace/PCRE/Sequence.hs b/Text/RE/ZeInternals/SearchReplace/PCRE/Sequence.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/SearchReplace/PCRE/Sequence.hs
@@ -0,0 +1,58 @@
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+
+module Text.RE.ZeInternals.SearchReplace.PCRE.Sequence
+  ( ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_
+  ) where
+
+import qualified Data.Sequence                 as S
+import           Language.Haskell.TH
+import           Language.Haskell.TH.Quote
+import           Text.RE.ZeInternals.PCRE
+import           Text.RE.ZeInternals.SearchReplace.PCREEdPrime
+import           Text.RE.REOptions
+import           Text.RE.ZeInternals.Types.SearchReplace
+
+
+-- | the @[ed| ... /// ... |]@ quasi quoters
+ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_ :: QuasiQuoter
+
+ed                       = ed' sr_cast $ Just minBound
+edMS                     = edMultilineSensitive
+edMI                     = edMultilineInsensitive
+edBS                     = edBlockSensitive
+edBI                     = edBlockInsensitive
+edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
+edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
+edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
+edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
+ed_                      = ed' fn_cast   Nothing
+
+sr_cast :: Q Exp
+sr_cast = [|\x -> x :: SearchReplace RE (S.Seq Char)|]
+
+fn_cast :: Q Exp
+fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE (S.Seq Char)|]
diff --git a/Text/RE/ZeInternals/SearchReplace/PCRE/String.hs b/Text/RE/ZeInternals/SearchReplace/PCRE/String.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/SearchReplace/PCRE/String.hs
@@ -0,0 +1,58 @@
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+
+module Text.RE.ZeInternals.SearchReplace.PCRE.String
+  ( ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_
+  ) where
+
+
+import           Language.Haskell.TH
+import           Language.Haskell.TH.Quote
+import           Text.RE.ZeInternals.PCRE
+import           Text.RE.ZeInternals.SearchReplace.PCREEdPrime
+import           Text.RE.REOptions
+import           Text.RE.ZeInternals.Types.SearchReplace
+
+
+-- | the @[ed| ... /// ... |]@ quasi quoters
+ed
+  , edMS
+  , edMI
+  , edBS
+  , edBI
+  , edMultilineSensitive
+  , edMultilineInsensitive
+  , edBlockSensitive
+  , edBlockInsensitive
+  , ed_ :: QuasiQuoter
+
+ed                       = ed' sr_cast $ Just minBound
+edMS                     = edMultilineSensitive
+edMI                     = edMultilineInsensitive
+edBS                     = edBlockSensitive
+edBI                     = edBlockInsensitive
+edMultilineSensitive     = ed' sr_cast $ Just  MultilineSensitive
+edMultilineInsensitive   = ed' sr_cast $ Just  MultilineInsensitive
+edBlockSensitive         = ed' sr_cast $ Just  BlockSensitive
+edBlockInsensitive       = ed' sr_cast $ Just  BlockInsensitive
+ed_                      = ed' fn_cast   Nothing
+
+sr_cast :: Q Exp
+sr_cast = [|\x -> x :: SearchReplace RE String|]
+
+fn_cast :: Q Exp
+fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE String|]
diff --git a/Text/RE/ZeInternals/SearchReplace/PCREEdPrime.hs b/Text/RE/ZeInternals/SearchReplace/PCREEdPrime.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/ZeInternals/SearchReplace/PCREEdPrime.hs
@@ -0,0 +1,62 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
+{-# LANGUAGE FlexibleContexts           #-}
+{-# LANGUAGE CPP                        #-}
+#if __GLASGOW_HASKELL__ >= 800
+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
+{-# LANGUAGE TemplateHaskellQuotes      #-}
+#else
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE TemplateHaskell            #-}
+#endif
+
+module Text.RE.ZeInternals.SearchReplace.PCREEdPrime
+  ( ed'
+  ) where
+
+import           Language.Haskell.TH
+import           Language.Haskell.TH.Quote
+import           Prelude.Compat
+import           Text.RE.ZeInternals.SearchReplace
+import           Text.RE.ZeInternals.QQ
+import           Text.RE.ZeInternals.PCRE
+import           Text.RE.IsRegex
+import           Text.RE.REOptions
+import           Text.RE.Replace
+import           Text.Regex.PCRE
+
+
+-- | construct a quasi quoter from a casting function and @Just sro@
+-- if the options are known, otherwise a function take takes the
+-- 'SimpleREOptions' and constructs the 'SearchReplace' template
+ed' :: Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
+ed' qe mb = case mb of
+  Nothing  ->
+    (qq0 "ed'")
+      { quoteExp = parse minBound $ \rs -> AppE <$> qe <*> [|flip unsafe_compile_sr rs|]
+      }
+  Just sro ->
+    (qq0 "ed'")
+      { quoteExp = parse sro $ \rs -> AppE <$> qe <*> [|unsafe_compile_sr_simple sro rs|]
+      }
+  where
+    parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp
+    parse sro mk ts = either error (\_->mk ts) ei
+      where
+        ei :: Either String (SearchReplace RE String)
+        ei = compileSearchReplace_ id (compileRegexWith sro) ts
+
+unsafe_compile_sr_simple :: IsRegex RE s
+                         => SimpleREOptions
+                         -> String
+                         -> SearchReplace RE s
+unsafe_compile_sr_simple sro =
+    unsafe_compile_sr $ unpackSimpleREOptions sro
+
+unsafe_compile_sr :: ( IsOption o RE CompOption ExecOption
+                              , IsRegex RE s
+                              )
+                           => o
+                           -> String
+                           -> SearchReplace RE s
+unsafe_compile_sr os =
+    unsafeCompileSearchReplace_ packR $ compileRegexWithOptions os
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,5 +1,10 @@
 -*-change-log-*-
 
+0.11.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-29
+  * Simplify API (#97)
+  * Rename Location to RELocation (#98)
+  * Rename the MacrosDescriptor Fields #99
+
 0.10.0.3 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-28
   * Update to LTS-8.6 (#95)
   * Improve Haddocks for Text.RE.{TDFA,PCRE} (#94)
diff --git a/regex-with-pcre.cabal b/regex-with-pcre.cabal
--- a/regex-with-pcre.cabal
+++ b/regex-with-pcre.cabal
@@ -1,5 +1,5 @@
 Name:                   regex-with-pcre
-Version:                0.10.0.3
+Version:                0.11.0.0
 Synopsis:               Toolkit for regex-base
 Description:            A Regular Expression Toolkit for regex-base with
                         Compile-time checking of RE syntax, data types for
@@ -31,7 +31,7 @@
 Source-Repository this
     Type:               git
     Location:           https://github.com/iconnect/regex.git
-    Tag:                0.10.0.3
+    Tag:                0.11.0.0
 
 
 
@@ -42,19 +42,19 @@
       Text.RE.PCRE
       Text.RE.PCRE.ByteString
       Text.RE.PCRE.ByteString.Lazy
-      Text.RE.PCRE.RE
+      Text.RE.ZeInternals.PCRE
       Text.RE.PCRE.Sequence
       Text.RE.PCRE.String
 
     Other-Modules:
-      Text.RE.Internal.QQ
-      Text.RE.Internal.SearchReplace
-      Text.RE.Internal.SearchReplace.PCRE
-      Text.RE.Internal.SearchReplace.PCRE.ByteString
-      Text.RE.Internal.SearchReplace.PCRE.ByteString.Lazy
-      Text.RE.Internal.SearchReplace.PCRE.Sequence
-      Text.RE.Internal.SearchReplace.PCRE.String
-      Text.RE.Internal.SearchReplace.PCREEdPrime
+      Text.RE.ZeInternals.QQ
+      Text.RE.ZeInternals.SearchReplace
+      Text.RE.ZeInternals.SearchReplace.PCRE
+      Text.RE.ZeInternals.SearchReplace.PCRE.ByteString
+      Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy
+      Text.RE.ZeInternals.SearchReplace.PCRE.Sequence
+      Text.RE.ZeInternals.SearchReplace.PCRE.String
+      Text.RE.ZeInternals.SearchReplace.PCREEdPrime
 
     Default-Language:   Haskell2010
 
@@ -89,7 +89,7 @@
       -Wwarn
 
     Build-depends:
-        regex                == 0.10.0.3
+        regex                == 0.11.0.0
       , base                 >= 4 && < 5
       , base-compat          >= 0.6.0
       , bytestring           >= 0.10.2.0
