diff --git a/README.markdown b/README.markdown
--- a/README.markdown
+++ b/README.markdown
@@ -49,7 +49,7 @@
 
 &nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-02-26  v0.3.0.0  [API adjustments](https://github.com/iconnect/regex/milestone/2)
 
-&nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-03-05  v0.5.0.0  [Ready for review: tutorials and examples finalized](https://github.com/iconnect/regex/milestone/6)
+&nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-05  v0.5.0.0  [Ready for review: API, tutorials and examples finalized](https://github.com/iconnect/regex/milestone/6)
 
 &nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-03-20  v1.0.0.0  [First stable release](https://github.com/iconnect/regex/milestone/3)
 
diff --git a/Text/RE/Capture.lhs b/Text/RE/Capture.lhs
--- a/Text/RE/Capture.lhs
+++ b/Text/RE/Capture.lhs
@@ -3,6 +3,7 @@
 {-# LANGUAGE FlexibleInstances          #-}
 {-# LANGUAGE UndecidableInstances       #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
+{-# LANGUAGE DeriveDataTypeable         #-}
 \end{code}
 
 \begin{code}
@@ -40,6 +41,7 @@
 \begin{code}
 import           Data.Array
 import           Data.Maybe
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE.CaptureID
 
@@ -56,7 +58,7 @@
     { matchesSource :: !a          -- ^ the source text being matched
     , allMatches    :: ![Match a]  -- ^ all captures found, left to right
     }
-  deriving (Show,Eq)
+  deriving (Show,Eq,Typeable)
 \end{code}
 
 \begin{code}
@@ -74,7 +76,7 @@
                                         -- text matched by the
                                         -- whole RE
     }
-  deriving (Show,Eq)
+  deriving (Show,Eq,Typeable)
 \end{code}
 
 \begin{code}
diff --git a/Text/RE/Internal/AddCaptureNames.hs b/Text/RE/Internal/AddCaptureNames.hs
--- a/Text/RE/Internal/AddCaptureNames.hs
+++ b/Text/RE/Internal/AddCaptureNames.hs
@@ -1,11 +1,69 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
+{-# LANGUAGE DeriveDataTypeable         #-}
+{-# LANGUAGE ExistentialQuantification  #-}
+{-# LANGUAGE ScopedTypeVariables        #-}
+{-# LANGUAGE OverloadedStrings          #-}
+
 module Text.RE.Internal.AddCaptureNames where
 
+import qualified Data.ByteString.Lazy.Char8    as LBS
+import qualified Data.ByteString.Char8         as B
+import           Data.Dynamic
+import           Data.Maybe
+import qualified Data.Sequence                 as S
+import qualified Data.Text                     as T
+import qualified Data.Text.Lazy                as TL
+import           Prelude.Compat
 import           Text.RE
+import           Unsafe.Coerce
 
 
+-- | a convenience function used by the API modules to insert
+-- capture names extracted from the parsed RE into the (*=~) result
 addCaptureNamesToMatches :: CaptureNames -> Matches a -> Matches a
 addCaptureNamesToMatches cnms mtchs =
   mtchs { allMatches = map (addCaptureNamesToMatch cnms) $ allMatches mtchs }
 
+-- | a convenience function used by the API modules to insert
+-- capture names extracted from the parsed RE into the (?=~) result
 addCaptureNamesToMatch :: CaptureNames -> Match a -> Match a
 addCaptureNamesToMatch cnms mtch = mtch { captureNames = cnms }
+
+-- | a hairy dynamically-typed function used with the legacy (=~) and (=~~)
+-- to see if it can/should add the capture names extracted from the RE
+-- into the polymorphic result of the operator (it does for any Match
+-- or Matches type, provided it is parameterised over a recognised type).
+-- The test suite is all over this one, testing all of these cases.
+addCaptureNames :: Typeable a => CaptureNames -> a -> a
+addCaptureNames cnms x = fromMaybe x $ listToMaybe $ catMaybes
+    [ test_match   x ( proxy :: String         )
+    , test_matches x ( proxy :: String         )
+    , test_match   x ( proxy :: B.ByteString   )
+    , test_matches x ( proxy :: B.ByteString   )
+    , test_match   x ( proxy :: LBS.ByteString )
+    , test_matches x ( proxy :: LBS.ByteString )
+    , test_match   x ( proxy :: T.Text         )
+    , test_matches x ( proxy :: T.Text         )
+    , test_match   x ( proxy :: TL.Text        )
+    , test_matches x ( proxy :: TL.Text        )
+    , test_match   x ( proxy :: S.Seq Char     )
+    , test_matches x ( proxy :: S.Seq Char     )
+    ]
+  where
+    test_match :: Typeable t => r -> t -> Maybe r
+    test_match r t = f r t $ addCaptureNamesToMatch cnms <$> fromDynamic dyn
+      where
+        f :: r' -> t' -> Maybe (Match t') -> Maybe r'
+        f _ _ = unsafeCoerce
+
+    test_matches :: Typeable t => r -> t -> Maybe r
+    test_matches r t = f r t $ addCaptureNamesToMatches cnms <$> fromDynamic dyn
+      where
+        f :: r' -> t' -> Maybe (Matches t') -> Maybe r'
+        f _ _ = unsafeCoerce
+
+    dyn :: Dynamic
+    dyn = toDyn x
+
+    proxy :: a
+    proxy = error "addCaptureNames"
diff --git a/Text/RE/Internal/EscapeREString.hs b/Text/RE/Internal/EscapeREString.hs
new file mode 100644
--- /dev/null
+++ b/Text/RE/Internal/EscapeREString.hs
@@ -0,0 +1,25 @@
+module Text.RE.Internal.EscapeREString where
+
+escapeREString :: String -> String
+escapeREString = foldr esc []
+  where
+    esc c t | isMetaChar c = '\\' : c : t
+            | otherwise    = c : t
+
+isMetaChar :: Char -> Bool
+isMetaChar c = case c of
+  '^'  -> True
+  '\\' -> True
+  '.'  -> True
+  '|'  -> True
+  '*'  -> True
+  '?'  -> True
+  '+'  -> True
+  '('  -> True
+  ')'  -> True
+  '['  -> True
+  ']'  -> True
+  '{'  -> True
+  '}'  -> True
+  '$'  -> True
+  _    -> False
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
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.PCRE.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.ByteString               as B
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext PCRE.Regex B.ByteString a
+(=~) :: ( Typeable a
+        , RegexContext PCRE.Regex B.ByteString a
         , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
         )
      => B.ByteString
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext PCRE.Regex B.ByteString a
          , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
          )
       => B.ByteString
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE B.ByteString where
   matchOnce   = flip (?=~)
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
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.PCRE.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.ByteString.Lazy          as LBS
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext PCRE.Regex LBS.ByteString a
+(=~) :: ( Typeable a
+        , RegexContext PCRE.Regex LBS.ByteString a
         , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
         )
      => LBS.ByteString
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext PCRE.Regex LBS.ByteString a
          , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
          )
       => LBS.ByteString
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE LBS.ByteString where
   matchOnce   = flip (?=~)
diff --git a/Text/RE/PCRE/RE.hs b/Text/RE/PCRE/RE.hs
--- a/Text/RE/PCRE/RE.hs
+++ b/Text/RE/PCRE/RE.hs
@@ -42,6 +42,8 @@
   , defaultOptions
   , unpackSimpleRegexOptions
   , compileRegex
+  , escape
+  , escapeREString
   ) where
 
 import           Data.Bits
@@ -50,6 +52,7 @@
 import           Language.Haskell.TH.Quote
 import           Prelude.Compat
 import           Text.RE
+import           Text.RE.Internal.EscapeREString
 import           Text.RE.Internal.NamedCaptures
 import           Text.RE.Internal.PreludeMacros
 import           Text.RE.Internal.QQ
@@ -243,3 +246,6 @@
 
 preludeSource :: PreludeMacro -> String
 preludeSource = preludeMacroSource PCRE
+
+escape :: (String->String) -> String -> RE
+escape f = unsafeCompileRegex () . f . escapeREString
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
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.PCRE.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.Sequence                 as S
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext PCRE.Regex (S.Seq Char) a
+(=~) :: ( Typeable a
+        , RegexContext PCRE.Regex (S.Seq Char) a
         , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
         )
      => (S.Seq Char)
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext PCRE.Regex (S.Seq Char) a
          , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
          )
       => (S.Seq Char)
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE (S.Seq Char) where
   matchOnce   = flip (?=~)
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
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.PCRE.RE
   ) where
 
+import           Prelude.Compat
 
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext PCRE.Regex String a
+(=~) :: ( Typeable a
+        , RegexContext PCRE.Regex String a
         , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
         )
      => String
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext PCRE.Regex String a
          , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String
          )
       => String
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE String where
   matchOnce   = flip (?=~)
diff --git a/Text/RE/Replace.lhs b/Text/RE/Replace.lhs
--- a/Text/RE/Replace.lhs
+++ b/Text/RE/Replace.lhs
@@ -44,6 +44,7 @@
 import           Text.RE.Capture
 import           Text.RE.CaptureID
 import           Text.RE.Options
+import           Text.Read
 import           Text.Regex.TDFA
 import           Text.Regex.TDFA.Text()
 import           Text.Regex.TDFA.Text.Lazy()
@@ -402,29 +403,31 @@
 
 \begin{code}
 parseTemplateE' :: ( Replace a
-              , RegexContext Regex a (Matches a)
-              , RegexMaker   Regex CompOption ExecOption String
-              )
-           => (a->String)
-           -> a
-           -> Match a
-           -> Location
-           -> Capture a
-           -> Maybe a
+                   , RegexContext Regex a (Matches a)
+                   , RegexMaker   Regex CompOption ExecOption String
+                   )
+                   => (a->String)
+                   -> a
+                   -> Match a
+                   -> Location
+                   -> Capture a
+                   -> Maybe a
 parseTemplateE' unpack tpl mtch _ _ =
     Just $ replaceAllCaptures TOP phi $
-      tpl $=~ [here|\$(\$|[0-9]+|\{([^{}]+)\})|]
+      tpl $=~ [here|\$(\$|[0-9]|\{([^{}]+)\})|]
   where
-    phi t_mtch _ _ = case t_mtch !$? c2  of
-      Just cap -> this $ IsCaptureName $ CaptureName txt
+    phi t_mtch _ _ = case t_mtch !$? c2 of
+      Just cap -> case readMaybe stg of
+          Nothing -> this $ IsCaptureName    $ CaptureName $ T.pack stg
+          Just cn -> this $ IsCaptureOrdinal $ CaptureOrdinal cn
         where
-          txt = T.pack $ unpack $ capturedText cap
+          stg = unpack $ capturedText cap
       Nothing -> case s == "$" of
         True  -> Just t
         False -> this $ IsCaptureOrdinal $ CaptureOrdinal $ read s
       where
-        s  = unpack t
-        t  = capturedText $ capture c1 t_mtch
+        s = unpack t
+        t = capturedText $ capture c1 t_mtch
 
         this cid = capturedText <$> mtch !$? cid
 
diff --git a/Text/RE/TDFA/ByteString.hs b/Text/RE/TDFA/ByteString.hs
--- a/Text/RE/TDFA/ByteString.hs
+++ b/Text/RE/TDFA/ByteString.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.TDFA.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.ByteString               as B
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext TDFA.Regex B.ByteString a
+(=~) :: ( Typeable a
+        , RegexContext TDFA.Regex B.ByteString a
         , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
         )
      => B.ByteString
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext TDFA.Regex B.ByteString a
          , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
          )
       => B.ByteString
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE B.ByteString where
   matchOnce   = flip (?=~)
diff --git a/Text/RE/TDFA/ByteString/Lazy.hs b/Text/RE/TDFA/ByteString/Lazy.hs
--- a/Text/RE/TDFA/ByteString/Lazy.hs
+++ b/Text/RE/TDFA/ByteString/Lazy.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.TDFA.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.ByteString.Lazy.Char8    as LBS
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext TDFA.Regex LBS.ByteString a
+(=~) :: ( Typeable a
+        , RegexContext TDFA.Regex LBS.ByteString a
         , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
         )
      => LBS.ByteString
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext TDFA.Regex LBS.ByteString a
          , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
          )
       => LBS.ByteString
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE LBS.ByteString where
   matchOnce   = flip (?=~)
diff --git a/Text/RE/TDFA/RE.hs b/Text/RE/TDFA/RE.hs
--- a/Text/RE/TDFA/RE.hs
+++ b/Text/RE/TDFA/RE.hs
@@ -42,6 +42,8 @@
   , preludeSource
   , unpackSimpleRegexOptions
   , compileRegex
+  , escape
+  , escapeREString
   ) where
 
 import           Data.Functor.Identity
@@ -49,6 +51,7 @@
 import           Language.Haskell.TH.Quote
 import           Prelude.Compat
 import           Text.RE
+import           Text.RE.Internal.EscapeREString
 import           Text.RE.Internal.NamedCaptures
 import           Text.RE.Internal.PreludeMacros
 import           Text.RE.Internal.QQ
@@ -239,3 +242,6 @@
 
 preludeSource :: PreludeMacro -> String
 preludeSource = preludeMacroSource TDFA
+
+escape :: (String->String) -> String -> RE
+escape f = unsafeCompileRegex () . f . escapeREString
diff --git a/Text/RE/TDFA/Sequence.hs b/Text/RE/TDFA/Sequence.hs
--- a/Text/RE/TDFA/Sequence.hs
+++ b/Text/RE/TDFA/Sequence.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.TDFA.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.Sequence                 as S
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext TDFA.Regex (S.Seq Char) a
+(=~) :: ( Typeable a
+        , RegexContext TDFA.Regex (S.Seq Char) a
         , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
         )
      => (S.Seq Char)
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext TDFA.Regex (S.Seq Char) a
          , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
          )
       => (S.Seq Char)
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE (S.Seq Char) where
   matchOnce   = flip (?=~)
diff --git a/Text/RE/TDFA/String.hs b/Text/RE/TDFA/String.hs
--- a/Text/RE/TDFA/String.hs
+++ b/Text/RE/TDFA/String.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.TDFA.RE
   ) where
 
+import           Prelude.Compat
 
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext TDFA.Regex String a
+(=~) :: ( Typeable a
+        , RegexContext TDFA.Regex String a
         , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
         )
      => String
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext TDFA.Regex String a
          , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
          )
       => String
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE String where
   matchOnce   = flip (?=~)
diff --git a/Text/RE/TDFA/Text.hs b/Text/RE/TDFA/Text.hs
--- a/Text/RE/TDFA/Text.hs
+++ b/Text/RE/TDFA/Text.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.TDFA.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.Text                     as T
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext TDFA.Regex T.Text a
+(=~) :: ( Typeable a
+        , RegexContext TDFA.Regex T.Text a
         , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
         )
      => T.Text
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext TDFA.Regex T.Text a
          , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
          )
       => T.Text
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE T.Text where
   matchOnce   = flip (?=~)
diff --git a/Text/RE/TDFA/Text/Lazy.hs b/Text/RE/TDFA/Text/Lazy.hs
--- a/Text/RE/TDFA/Text/Lazy.hs
+++ b/Text/RE/TDFA/Text/Lazy.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NoImplicitPrelude          #-}
 {-# LANGUAGE MultiParamTypeClasses      #-}
 {-# LANGUAGE FlexibleContexts           #-}
 {-# LANGUAGE FlexibleInstances          #-}
@@ -25,7 +26,9 @@
   , module Text.RE.TDFA.RE
   ) where
 
+import           Prelude.Compat
 import qualified Data.Text.Lazy                as TL
+import           Data.Typeable
 import           Text.Regex.Base
 import           Text.RE
 import           Text.RE.Internal.AddCaptureNames
@@ -46,23 +49,26 @@
 (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base polymorphic match operator
-(=~) :: ( RegexContext TDFA.Regex TL.Text a
+(=~) :: ( Typeable a
+        , RegexContext TDFA.Regex TL.Text a
         , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
         )
      => TL.Text
      -> RE
      -> a
-(=~) bs rex = match (reRegex rex) bs
+(=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs
 
 -- | the regex-base monadic, polymorphic match operator
 (=~~) :: ( Monad m
+         , Functor m
+         , Typeable a
          , RegexContext TDFA.Regex TL.Text a
          , RegexMaker   TDFA.Regex TDFA.CompOption TDFA.ExecOption String
          )
       => TL.Text
       -> RE
       -> m a
-(=~~) bs rex = matchM (reRegex rex) bs
+(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs
 
 instance IsRegex RE TL.Text where
   matchOnce   = flip (?=~)
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,5 +1,14 @@
 -*-change-log-*-
 
+0.5.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-05
+  * Fix inter-operation of =~ & =~~ and named captures (#55)
+  * Add escaping functions (#37)
+  * Test Hackage release tarballs on Travis CI (#51)
+  * Fix up template replace ordinals (#52)
+  * Complete the web site (#39)
+  * Complete the Tutorial, Tests and Examples (#38)
+  * Complete narrative in literate modules (#8)
+
 0.3.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-02-26
   * Clean up API to use camelCase conventions
   * Use -Werror in development and testing, -Warn for Hackage
diff --git a/regex.cabal b/regex.cabal
--- a/regex.cabal
+++ b/regex.cabal
@@ -1,5 +1,5 @@
 Name:                   regex
-Version:                0.3.0.0
+Version:                0.5.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.3.0.0
+    Tag:                0.5.0.0
 
 
 
@@ -42,6 +42,8 @@
       Text.RE.Capture
       Text.RE.CaptureID
       Text.RE.Edit
+      Text.RE.Internal.AddCaptureNames
+      Text.RE.Internal.EscapeREString
       Text.RE.Internal.NamedCaptures
       Text.RE.Internal.PreludeMacros
       Text.RE.Internal.QQ
@@ -68,9 +70,6 @@
       Text.RE.Tools.Grep
       Text.RE.Tools.Lex
       Text.RE.Tools.Sed
-
-    Other-Modules:
-      Text.RE.Internal.AddCaptureNames
 
     Default-Language:   Haskell2010
     GHC-Options:
