diff --git a/Text/RE.hs b/Text/RE.hs
--- a/Text/RE.hs
+++ b/Text/RE.hs
@@ -64,6 +64,6 @@
 --
 -- * "Text.RE.REOptions" for specifying back-end specific options;
 -- * "Text.RE.Replace"   for the full text-replacement toolkit;
--- * "Text.RE.TestBench" for building up, testing and doumenting;
+-- * "Text.RE.TestBench" for building up, testing and documenting;
 --   macro environments  for use in REs;
 -- * "Text.RE.Tools"     for an AWK-like text-processing toolkit.
diff --git a/Text/RE/REOptions.lhs b/Text/RE/REOptions.lhs
--- a/Text/RE/REOptions.lhs
+++ b/Text/RE/REOptions.lhs
@@ -39,7 +39,7 @@
 
 \begin{code}
 -- | the default API uses these simple, universal RE options,
--- which get auto-converted into the apropriate back-end 'REOptions_'
+-- which get auto-converted into the appropriate back-end 'REOptions_'
 data SimpleREOptions
   = MultilineSensitive        -- ^ case-sensitive with ^ and $ matching the start and end of a line
   | MultilineInsensitive      -- ^ case-insensitive with ^ and $ matsh the start and end of a line
@@ -60,7 +60,7 @@
 -- and its @CompOption@ and @ExecOption@ types (the compile-time and
 -- execution time options, respectively); each back end will define an
 -- @REOptions@ type that fills out these three type parameters with the
--- apropriate types (see, for example, "Text.RE.TDFA")
+-- appropriate types (see, for example, "Text.RE.TDFA")
 data REOptions_ r c e =
   REOptions
     { optionsMacs :: !(Macros r)    -- ^ the available TestBench RE macros
diff --git a/Text/RE/TDFA.hs b/Text/RE/TDFA.hs
--- a/Text/RE/TDFA.hs
+++ b/Text/RE/TDFA.hs
@@ -193,7 +193,7 @@
 -- This module provides access to the back end through polymorphic functions
 -- that operate over all of the String\/Text\/ByteString types supported by the
 -- back end. The module also provides all of the specialised back-end functionality
--- that will not be needed by most regex clientts. If you don't need this generality
+-- that will not be needed by most regex clients. If you don't need this generality
 -- then you might want to consider using one of the simpler modules that have been
 -- specialised for each of these types:
 --
@@ -222,7 +222,7 @@
 -- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
 -- quasi quoters, which generate functions that take an 'IsOption' option
 -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
--- as apropriate. For example if you have a 'SimpleReOptions' value in
+-- as appropriate. For example if you have a 'SimpleReOptions' value in
 -- @sro@ then
 --
 --  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@
@@ -231,7 +231,7 @@
 -- on specifying RE options see "Text.RE.REOptions".
 
 -- $re
--- The @[re|.*|]@ quasi quoters, with variants for specifing different
+-- The @[re|.*|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions"), and the
 -- specialised back-end types and functions.
 
@@ -243,11 +243,11 @@
 -- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
 -- into a DD\/MM\/YYYY format date.
 --
--- The only difference betweem these quasi quoters is the RE options that are set,
+-- The only difference between these quasi quoters is the RE options that are set,
 -- using the same conventions as the @[re| ... |]@ quasi quoters.
 
 -- $isregex
--- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- The 'IsRegex' class is used to abstract over the different regex back ends and
 -- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
 
 -- $instances
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
@@ -186,7 +186,7 @@
 -- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
 -- quasi quoters, which generate functions that take an 'IsOption' option
 -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
--- as apropriate. For example if you have a 'SimpleReOptions' value in
+-- as appropriate. For example if you have a 'SimpleReOptions' value in
 -- @sro@ then
 --
 --  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@
@@ -195,12 +195,12 @@
 -- on specifying RE options see "Text.RE.REOptions".
 
 -- $re
--- The @[re|.*|]@ quasi quoters, with variants for specifing different
+-- The @[re|.*|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions"), and the
 -- specialised back-end types and functions.
 
 -- $ed
--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different
+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions").
 
 -- $ed
@@ -211,9 +211,9 @@
 -- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
 -- into a DD\/MM\/YYYY format date.
 --
--- The only difference betweem these quasi quoters is the RE options that are set,
+-- The only difference between these quasi quoters is the RE options that are set,
 -- using the same conventions as the @[re| ... |]@ quasi quoters.
 
 -- $isregex
--- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- The 'IsRegex' class is used to abstract over the different regex back ends and
 -- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
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
@@ -186,7 +186,7 @@
 -- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
 -- quasi quoters, which generate functions that take an 'IsOption' option
 -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
--- as apropriate. For example if you have a 'SimpleReOptions' value in
+-- as appropriate. For example if you have a 'SimpleReOptions' value in
 -- @sro@ then
 --
 --  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@
@@ -195,12 +195,12 @@
 -- on specifying RE options see "Text.RE.REOptions".
 
 -- $re
--- The @[re|.*|]@ quasi quoters, with variants for specifing different
+-- The @[re|.*|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions"), and the
 -- specialised back-end types and functions.
 
 -- $ed
--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different
+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions").
 
 -- $ed
@@ -211,9 +211,9 @@
 -- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
 -- into a DD\/MM\/YYYY format date.
 --
--- The only difference betweem these quasi quoters is the RE options that are set,
+-- The only difference between these quasi quoters is the RE options that are set,
 -- using the same conventions as the @[re| ... |]@ quasi quoters.
 
 -- $isregex
--- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- The 'IsRegex' class is used to abstract over the different regex back ends and
 -- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
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
@@ -186,7 +186,7 @@
 -- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
 -- quasi quoters, which generate functions that take an 'IsOption' option
 -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
--- as apropriate. For example if you have a 'SimpleReOptions' value in
+-- as appropriate. For example if you have a 'SimpleReOptions' value in
 -- @sro@ then
 --
 --  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@
@@ -195,12 +195,12 @@
 -- on specifying RE options see "Text.RE.REOptions".
 
 -- $re
--- The @[re|.*|]@ quasi quoters, with variants for specifing different
+-- The @[re|.*|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions"), and the
 -- specialised back-end types and functions.
 
 -- $ed
--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different
+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions").
 
 -- $ed
@@ -211,9 +211,9 @@
 -- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
 -- into a DD\/MM\/YYYY format date.
 --
--- The only difference betweem these quasi quoters is the RE options that are set,
+-- The only difference between these quasi quoters is the RE options that are set,
 -- using the same conventions as the @[re| ... |]@ quasi quoters.
 
 -- $isregex
--- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- The 'IsRegex' class is used to abstract over the different regex back ends and
 -- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
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
@@ -186,7 +186,7 @@
 -- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
 -- quasi quoters, which generate functions that take an 'IsOption' option
 -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
--- as apropriate. For example if you have a 'SimpleReOptions' value in
+-- as appropriate. For example if you have a 'SimpleReOptions' value in
 -- @sro@ then
 --
 --  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@
@@ -195,12 +195,12 @@
 -- on specifying RE options see "Text.RE.REOptions".
 
 -- $re
--- The @[re|.*|]@ quasi quoters, with variants for specifing different
+-- The @[re|.*|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions"), and the
 -- specialised back-end types and functions.
 
 -- $ed
--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different
+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions").
 
 -- $ed
@@ -211,9 +211,9 @@
 -- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
 -- into a DD\/MM\/YYYY format date.
 --
--- The only difference betweem these quasi quoters is the RE options that are set,
+-- The only difference between these quasi quoters is the RE options that are set,
 -- using the same conventions as the @[re| ... |]@ quasi quoters.
 
 -- $isregex
--- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- The 'IsRegex' class is used to abstract over the different regex back ends and
 -- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
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
@@ -186,7 +186,7 @@
 -- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
 -- quasi quoters, which generate functions that take an 'IsOption' option
 -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
--- as apropriate. For example if you have a 'SimpleReOptions' value in
+-- as appropriate. For example if you have a 'SimpleReOptions' value in
 -- @sro@ then
 --
 --  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@
@@ -195,12 +195,12 @@
 -- on specifying RE options see "Text.RE.REOptions".
 
 -- $re
--- The @[re|.*|]@ quasi quoters, with variants for specifing different
+-- The @[re|.*|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions"), and the
 -- specialised back-end types and functions.
 
 -- $ed
--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different
+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions").
 
 -- $ed
@@ -211,9 +211,9 @@
 -- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
 -- into a DD\/MM\/YYYY format date.
 --
--- The only difference betweem these quasi quoters is the RE options that are set,
+-- The only difference between these quasi quoters is the RE options that are set,
 -- using the same conventions as the @[re| ... |]@ quasi quoters.
 
 -- $isregex
--- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- The 'IsRegex' class is used to abstract over the different regex back ends and
 -- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
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
@@ -186,7 +186,7 @@
 -- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
 -- quasi quoters, which generate functions that take an 'IsOption' option
 -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
--- as apropriate. For example if you have a 'SimpleReOptions' value in
+-- as appropriate. For example if you have a 'SimpleReOptions' value in
 -- @sro@ then
 --
 --  @(?=~/ [ed_|foo$\/\/\/bar|] sro)@
@@ -195,12 +195,12 @@
 -- on specifying RE options see "Text.RE.REOptions".
 
 -- $re
--- The @[re|.*|]@ quasi quoters, with variants for specifing different
+-- The @[re|.*|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions"), and the
 -- specialised back-end types and functions.
 
 -- $ed
--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different
+-- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifying different
 -- options to the RE compiler (see "Text.RE.REOptions").
 
 -- $ed
@@ -211,9 +211,9 @@
 -- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
 -- into a DD\/MM\/YYYY format date.
 --
--- The only difference betweem these quasi quoters is the RE options that are set,
+-- The only difference between these quasi quoters is the RE options that are set,
 -- using the same conventions as the @[re| ... |]@ quasi quoters.
 
 -- $isregex
--- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- The 'IsRegex' class is used to abstract over the different regex back ends and
 -- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
diff --git a/Text/RE/Tools/Edit.lhs b/Text/RE/Tools/Edit.lhs
--- a/Text/RE/Tools/Edit.lhs
+++ b/Text/RE/Tools/Edit.lhs
@@ -50,13 +50,13 @@
 -- | each Edit action specifies how the match should be processed
 data Edit m re s
   = Template !(SearchReplace re s)
-        -- ^ replace the match with this template text, substituting ${capture} as apropriate
+        -- ^ replace the match with this template text, substituting ${capture} as appropriate
   | Function !re REContext !(LineNo->Match s->RELocation->Capture s->m (Maybe s))
         -- ^ use this function to replace the 'REContext' specified captures in each line matched
   | LineEdit !re           !(LineNo->Matches s->m (LineEdit s))
         -- ^ use this function to edit each line matched
 
--- | a LineEdit is the most general action thar can be performed on a line
+-- | a LineEdit is the most general action that can be performed on a line
 -- and is the only means of deleting a line
 data LineEdit s
   = NoEdit                  -- ^ do not edit this line but leave as is
diff --git a/Text/RE/Tools/Grep.lhs b/Text/RE/Tools/Grep.lhs
--- a/Text/RE/Tools/Grep.lhs
+++ b/Text/RE/Tools/Grep.lhs
@@ -47,7 +47,7 @@
 \end{code}
 
 \begin{code}
--- | specifies whether to return the linss matched or missed
+-- | specifies whether to return the lines matched or missed
 data Verbosity
   = LinesMatched
   | LinesNotMatched
@@ -121,7 +121,7 @@
 
 \begin{code}
 -- $tutorial
--- The Grep toolkit matches REs againt each line of a text.
+-- The Grep toolkit matches REs against each line of a text.
 --
 -- See the Regex Tools tutorial at http://re-tutorial-tools.regex.uk
 \end{code}
diff --git a/Text/RE/Tools/Sed.lhs b/Text/RE/Tools/Sed.lhs
--- a/Text/RE/Tools/Sed.lhs
+++ b/Text/RE/Tools/Sed.lhs
@@ -87,7 +87,7 @@
 
 \begin{code}
 -- $tutorial
--- The Sed toolkit applyies @Edits@ scripts to each line
+-- The Sed toolkit applies @Edits@ scripts to each line
 -- of a text, running the actions and adjusting each line
 -- accordingly.
 --
diff --git a/Text/RE/ZeInternals/EscapeREString.hs b/Text/RE/ZeInternals/EscapeREString.hs
--- a/Text/RE/ZeInternals/EscapeREString.hs
+++ b/Text/RE/ZeInternals/EscapeREString.hs
@@ -8,7 +8,7 @@
     esc c t | isMetaChar c = '\\' : c : t
             | otherwise    = c : t
 
--- | returns True iff the charactr is an RE meta character
+-- | returns True iff the character is an RE meta character
 -- ('[', '*', '{', etc.)
 isMetaChar :: Char -> Bool
 isMetaChar c = case c of
diff --git a/Text/RE/ZeInternals/NamedCaptures.lhs b/Text/RE/ZeInternals/NamedCaptures.lhs
--- a/Text/RE/ZeInternals/NamedCaptures.lhs
+++ b/Text/RE/ZeInternals/NamedCaptures.lhs
@@ -47,7 +47,7 @@
       }
 
 -- | extract the CaptureNames from an RE or return an error diagnostic
--- if the RE is not well formed; also returs the total number of captures
+-- if the RE is not well formed; also returns the total number of captures
 -- in the RE
 extractNamedCaptures :: String -> Either String ((Int,CaptureNames),String)
 extractNamedCaptures s = Right (analyseTokens tks,formatTokens tks)
diff --git a/Text/RE/ZeInternals/PreludeMacros.hs b/Text/RE/ZeInternals/PreludeMacros.hs
--- a/Text/RE/ZeInternals/PreludeMacros.hs
+++ b/Text/RE/ZeInternals/PreludeMacros.hs
@@ -58,7 +58,7 @@
 preludeMacroSources rty =
   formatMacroSources rty ExclCaptures $ preludeMacroEnv rty
 
--- | generate plain text giving theexpanded RE for a single macro
+-- | generate plain text giving the expanded RE for a single macro
 preludeMacroSource :: RegexType -> PreludeMacro -> String
 preludeMacroSource rty =
   formatMacroSource rty ExclCaptures (preludeMacroEnv rty) . prelude_macro_id
diff --git a/Text/RE/ZeInternals/Replace.lhs b/Text/RE/ZeInternals/Replace.lhs
--- a/Text/RE/ZeInternals/Replace.lhs
+++ b/Text/RE/ZeInternals/Replace.lhs
@@ -289,7 +289,7 @@
 \end{code}
 
 \begin{code}
--- | expand the @{..} macos in the argument string using the given
+-- | expand the @{..} macros in the argument string using the given
 -- function
 expandMacros' :: (MacroID->Maybe String) -> String -> String
 expandMacros' lu = fixpoint e_m
@@ -404,7 +404,7 @@
 \end{code}
 
 \begin{code}
--- | a selction of the Replace methods can be encapsulated with ReplaceMethods
+-- | a selection of the Replace methods can be encapsulated with ReplaceMethods
 -- for the higher-order replacement functions
 data ReplaceMethods a =
   ReplaceMethods
@@ -495,7 +495,7 @@
 -------------------------
 
 \begin{code}
--- | parse the replacement template in second argument, substititing
+-- | parse the replacement template in second argument, substituting
 -- the capture references with corresponding captures from the Match
 -- in the third argument (the result of a single match of the RE
 -- against the input text to be matched); Nothing is returned if the
diff --git a/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString.hs b/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString.hs
--- a/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString.hs
+++ b/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString.hs
@@ -71,7 +71,7 @@
 --   @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@
 --
 -- prefixes the hexadecimal digit strings in s with @0x@, allowing for
--- upper- or lower-case hex didgits (which is entirely equivalent
+-- upper- or lower-case hex digits (which is entirely equivalent
 -- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).
 ed_                     :: QuasiQuoter
 ed_                      = ed' fn_cast   Nothing
diff --git a/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString/Lazy.hs b/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString/Lazy.hs
--- a/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString/Lazy.hs
+++ b/Text/RE/ZeInternals/SearchReplace/TDFA/ByteString/Lazy.hs
@@ -71,7 +71,7 @@
 --   @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@
 --
 -- prefixes the hexadecimal digit strings in s with @0x@, allowing for
--- upper- or lower-case hex didgits (which is entirely equivalent
+-- upper- or lower-case hex digits (which is entirely equivalent
 -- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).
 ed_                     :: QuasiQuoter
 ed_                      = ed' fn_cast   Nothing
diff --git a/Text/RE/ZeInternals/SearchReplace/TDFA/Sequence.hs b/Text/RE/ZeInternals/SearchReplace/TDFA/Sequence.hs
--- a/Text/RE/ZeInternals/SearchReplace/TDFA/Sequence.hs
+++ b/Text/RE/ZeInternals/SearchReplace/TDFA/Sequence.hs
@@ -71,7 +71,7 @@
 --   @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@
 --
 -- prefixes the hexadecimal digit strings in s with @0x@, allowing for
--- upper- or lower-case hex didgits (which is entirely equivalent
+-- upper- or lower-case hex digits (which is entirely equivalent
 -- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).
 ed_                     :: QuasiQuoter
 ed_                      = ed' fn_cast   Nothing
diff --git a/Text/RE/ZeInternals/SearchReplace/TDFA/String.hs b/Text/RE/ZeInternals/SearchReplace/TDFA/String.hs
--- a/Text/RE/ZeInternals/SearchReplace/TDFA/String.hs
+++ b/Text/RE/ZeInternals/SearchReplace/TDFA/String.hs
@@ -71,7 +71,7 @@
 --   @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@
 --
 -- prefixes the hexadecimal digit strings in s with @0x@, allowing for
--- upper- or lower-case hex didgits (which is entirely equivalent
+-- upper- or lower-case hex digits (which is entirely equivalent
 -- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).
 ed_                     :: QuasiQuoter
 ed_                      = ed' fn_cast   Nothing
diff --git a/Text/RE/ZeInternals/SearchReplace/TDFA/Text.hs b/Text/RE/ZeInternals/SearchReplace/TDFA/Text.hs
--- a/Text/RE/ZeInternals/SearchReplace/TDFA/Text.hs
+++ b/Text/RE/ZeInternals/SearchReplace/TDFA/Text.hs
@@ -71,7 +71,7 @@
 --   @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@
 --
 -- prefixes the hexadecimal digit strings in s with @0x@, allowing for
--- upper- or lower-case hex didgits (which is entirely equivalent
+-- upper- or lower-case hex digits (which is entirely equivalent
 -- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).
 ed_                     :: QuasiQuoter
 ed_                      = ed' fn_cast   Nothing
diff --git a/Text/RE/ZeInternals/SearchReplace/TDFA/Text/Lazy.hs b/Text/RE/ZeInternals/SearchReplace/TDFA/Text/Lazy.hs
--- a/Text/RE/ZeInternals/SearchReplace/TDFA/Text/Lazy.hs
+++ b/Text/RE/ZeInternals/SearchReplace/TDFA/Text/Lazy.hs
@@ -71,7 +71,7 @@
 --   @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@
 --
 -- prefixes the hexadecimal digit strings in s with @0x@, allowing for
--- upper- or lower-case hex didgits (which is entirely equivalent
+-- upper- or lower-case hex digits (which is entirely equivalent
 -- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).
 ed_                     :: QuasiQuoter
 ed_                      = ed' fn_cast   Nothing
diff --git a/Text/RE/ZeInternals/TDFA.hs b/Text/RE/ZeInternals/TDFA.hs
--- a/Text/RE/ZeInternals/TDFA.hs
+++ b/Text/RE/ZeInternals/TDFA.hs
@@ -310,7 +310,7 @@
 preludeSources :: String
 preludeSources = preludeMacroSources regexType
 
--- | the prolude source of a given macro in the standard environment
+-- | the prelude source of a given macro in the standard environment
 preludeSource :: PreludeMacro -> String
 preludeSource = preludeMacroSource regexType
 
@@ -363,7 +363,7 @@
 --   @countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive@
 --
 -- counts the number of hexadecimal digit strings in 's', allowing
--- for upper- or lower-case hex didgits (which is entirely equivalent
+-- for upper- or lower-case hex digits (which is entirely equivalent
 -- in this example to just using @[reMultilineInsensitive|[0-9a-f]+|]@).
 re_                     :: QuasiQuoter
 re_                      = re'   Nothing
diff --git a/Text/RE/ZeInternals/TestBench.lhs b/Text/RE/ZeInternals/TestBench.lhs
--- a/Text/RE/ZeInternals/TestBench.lhs
+++ b/Text/RE/ZeInternals/TestBench.lhs
@@ -84,7 +84,7 @@
   show (TDFA _) = "TDFA <function>"
   show (PCRE _) = "PCRE <function>"
 
--- | do we need the captures in the RE or whould they be stripped out
+-- | do we need the captures in the RE or would they be stripped out
 -- where possible
 data WithCaptures
   = InclCaptures      -- ^ include all captures
@@ -95,7 +95,7 @@
 -- required for each macro, so we use a Lazy HashMap
 type MacroEnv = HML.HashMap MacroID MacroDescriptor
 
--- | describes a macro, giving the text of the RE and a si=ummary
+-- | describes a macro, giving the text of the RE and a summary
 -- description
 data MacroDescriptor =
   MacroDescriptor
diff --git a/Text/RE/ZeInternals/Tools/Lex.lhs b/Text/RE/ZeInternals/Tools/Lex.lhs
--- a/Text/RE/ZeInternals/Tools/Lex.lhs
+++ b/Text/RE/ZeInternals/Tools/Lex.lhs
@@ -13,7 +13,7 @@
 
 
 \begin{code}
--- | a simple regex-based scanner interpretter for prototyping
+-- | a simple regex-based scanner interpreter for prototyping
 -- scanners
 alex :: IsRegex re s => [(re,Match s->Maybe t)] -> t -> s -> [t]
 alex = alex' matchOnce
diff --git a/Text/RE/ZeInternals/Types/IsRegex.lhs b/Text/RE/ZeInternals/Types/IsRegex.lhs
--- a/Text/RE/ZeInternals/Types/IsRegex.lhs
+++ b/Text/RE/ZeInternals/Types/IsRegex.lhs
@@ -36,7 +36,7 @@
   makeRegexWith         :: (Functor m,Monad m, MonadFail m) => SimpleREOptions -> s -> m re
   -- | compiling a 'SearchReplace' template from the RE text and the template Text, failing if they are not well formed
   makeSearchReplace     :: (Functor m,Monad m, MonadFail m,IsRegex re s) => s -> s -> m (SearchReplace re s)
-  -- | compiling a 'SearchReplace' template specifing the 'SimpleREOptions' for the RE
+  -- | compiling a 'SearchReplace' template specifying the 'SimpleREOptions' for the RE
   makeSearchReplaceWith :: (Functor m,Monad m, MonadFail m,IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
   -- | incorporate an escaped string into a compiled RE with the default options
   makeEscaped           :: (Functor m,Monad m, MonadFail m) => (s->s) -> s -> m re
diff --git a/Text/RE/ZeInternals/Types/Match.lhs b/Text/RE/ZeInternals/Types/Match.lhs
--- a/Text/RE/ZeInternals/Types/Match.lhs
+++ b/Text/RE/ZeInternals/Types/Match.lhs
@@ -246,7 +246,10 @@
     False -> skip 0 0     -- BW.index calls below should not fail
   where
     skip ix di = case compare ix ix0 of
-      GT -> error "utf8_correct_bs: UTF-8 decoding error"
+      GT -> case ix0 of
+        -- -1 is used as a magic number to indicate failure to match
+        -1 -> CharRange ix0 ln0
+        _ -> error "utf8_correct_bs: UTF-8 decoding error"
       EQ -> count ix di 0 ln0
       LT -> case u8_width $ BW.index bs ix of
         Single    -> skip (ix+1)   di
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,5 +1,8 @@
 -*-change-log-*-
 
+1.1.0.2 Igor Ranieri Elland 2022-05-20
+* fix for [#171](https://github.com/iconnect/regex/issues/171)
+
 1.1.0.1 Chris Dornan <chris.dornan@irisconnect.co.uk> 2018-12-19
   * fix for base-4.16.0.0/GHC 9.2.1
   * eliminate http-conduit dependency (currently stymied by cryptonite)
diff --git a/regex.cabal b/regex.cabal
--- a/regex.cabal
+++ b/regex.cabal
@@ -1,5 +1,5 @@
 Name:                   regex
-Version:                1.1.0.1
+Version:                1.1.0.2
 Synopsis:               Toolkit for regex-base
 Description:            A regular expression toolkit for regex-base with
                         compile-time checking of RE syntax, data types for
@@ -32,7 +32,7 @@
 Source-Repository this
     Type:               git
     Location:           https://github.com/iconnect/regex.git
-    Tag:                1.1.0.1
+    Tag:                1.1.0.2
 
 
 
