diff --git a/Text/Regex/PDeriv/ByteString/LeftToRight.lhs b/Text/Regex/PDeriv/ByteString/LeftToRight.lhs
--- a/Text/Regex/PDeriv/ByteString/LeftToRight.lhs
+++ b/Text/Regex/PDeriv/ByteString/LeftToRight.lhs
@@ -34,7 +34,7 @@
 
 > import Text.Regex.PDeriv.RE
 > import Text.Regex.PDeriv.Pretty (Pretty(..))
-> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsEmpty(..), nub2)
+> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsEmpty(..), nub2, minBinder, maxBinder)
 > import Text.Regex.PDeriv.IntPattern (Pat(..), pdPat, pdPat0, toBinder, Binder(..), strip, listifyBinder)
 > import Text.Regex.PDeriv.Parse
 > import qualified Text.Regex.PDeriv.Dictionary as D (Dictionary(..), Key(..), insertNotOverwrite, lookupAll, empty, isIn, nub)
@@ -328,8 +328,8 @@
 >  case greedyPatMatchCompiled r bs of
 >    Nothing -> Right (Nothing)
 >    Just env ->
->      let pre = case lookup (-1) env of { Just w -> w ; Nothing -> S.empty }
->          post = case lookup (-2) env of { Just w -> w ; Nothing -> S.empty }
+>      let pre = case lookup minBinder env of { Just w -> w ; Nothing -> S.empty }
+>          post = case lookup maxBinder env of { Just w -> w ; Nothing -> S.empty }
 >          full_len = S.length bs
 >          pre_len = S.length pre
 >          post_len = S.length post
diff --git a/Text/Regex/PDeriv/ByteString/LeftToRightD.lhs b/Text/Regex/PDeriv/ByteString/LeftToRightD.lhs
--- a/Text/Regex/PDeriv/ByteString/LeftToRightD.lhs
+++ b/Text/Regex/PDeriv/ByteString/LeftToRightD.lhs
@@ -34,7 +34,7 @@
 
 > import Text.Regex.PDeriv.RE
 > import Text.Regex.PDeriv.Pretty (Pretty(..))
-> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsEmpty(..), nub2)
+> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsEmpty(..), nub2, minBinder, maxBinder)
 > import Text.Regex.PDeriv.IntPattern (Pat(..), pdPat, pdPat0, toBinder, Binder(..), strip, listifyBinder)
 > import Text.Regex.PDeriv.Parse
 > import qualified Text.Regex.PDeriv.Dictionary as D (Dictionary(..), Key(..), insert, insertNotOverwrite, lookupAll, empty, isIn, nub)
@@ -402,8 +402,8 @@
 >  case greedyPatMatchCompiled r bs of
 >    Nothing -> Right (Nothing)
 >    Just env ->
->      let pre = case lookup (-1) env of { Just w -> w ; Nothing -> S.empty }
->          post = case lookup (-2) env of { Just w -> w ; Nothing -> S.empty }
+>      let pre = case lookup minBinder env of { Just w -> w ; Nothing -> S.empty }
+>          post = case lookup maxBinder env of { Just w -> w ; Nothing -> S.empty }
 >          full_len = S.length bs
 >          pre_len = S.length pre
 >          post_len = S.length post
diff --git a/Text/Regex/PDeriv/ByteString/Posix.lhs b/Text/Regex/PDeriv/ByteString/Posix.lhs
--- a/Text/Regex/PDeriv/ByteString/Posix.lhs
+++ b/Text/Regex/PDeriv/ByteString/Posix.lhs
@@ -36,7 +36,7 @@
 
 > import Text.Regex.PDeriv.RE
 > import Text.Regex.PDeriv.Pretty (Pretty(..))
-> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsEmpty(..), IsGreedy(..), nub2)
+> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsEmpty(..), IsGreedy(..), nub2, minBinder, maxBinder)
 > import Text.Regex.PDeriv.IntPattern (Pat(..), pdPat, toBinder, Binder(..), strip, listifyBinder)
 > import Text.Regex.PDeriv.Parse
 > import qualified Text.Regex.PDeriv.Dictionary as D (Dictionary(..), Key(..), insertNotOverwrite, lookupAll, empty, isIn, nub)
@@ -424,8 +424,8 @@
 >  case posixPatMatchCompiled r bs of
 >    Nothing -> Right (Nothing)
 >    Just env ->
->      let pre = case lookup (-1) env of { Just w -> w ; Nothing -> S.empty }
->          post = case lookup (-2) env of { Just w -> w ; Nothing -> S.empty }
+>      let pre = case lookup minBinder env of { Just w -> w ; Nothing -> S.empty }
+>          post = case lookup maxBinder env of { Just w -> w ; Nothing -> S.empty }
 >          full_len = S.length bs
 >          pre_len = S.length pre
 >          post_len = S.length post
@@ -503,9 +503,9 @@
 >     in io `seq` allbinders `seq` map (binderToMatchArray l) allbinders
 
 > binderToMatchArray l b  = 
->     let subPatB   = filter (\(x,_) -> x > 0) (listifyBinder b)
->         mbPrefixB = IM.lookup (-1) b
->         mbSubfixB = IM.lookup (-2) b
+>     let subPatB   = filter (\(x,_) -> x > minBinder && x < maxBinder) (listifyBinder b)
+>         mbPrefixB = IM.lookup minBinder b
+>         mbSubfixB = IM.lookup maxBinder b
 >         mainB     = case (mbPrefixB, mbSubfixB) of
 >                       (Just [(_,x)], Just [(y,_)]) -> (x + 1, y - (x + 1))
 >                       (Just [(_,x)], _)            -> (x + 1, l - (x + 1))
@@ -607,3 +607,6 @@
 
 > Right r64 =  compile defaultCompOpt defaultExecOpt (S.pack "^(a*?)(a*)(a*?)$")
 
+> Right up25 = compile defaultCompOpt defaultExecOpt (S.pack "^(.*?)(a|ab|ba)(.*)$")
+> Right up26 = compile defaultCompOpt defaultExecOpt (S.pack "(a|ab|ba)")
+> s25 = S.pack "aba"
diff --git a/Text/Regex/PDeriv/ByteString/RightToLeft.lhs b/Text/Regex/PDeriv/ByteString/RightToLeft.lhs
--- a/Text/Regex/PDeriv/ByteString/RightToLeft.lhs
+++ b/Text/Regex/PDeriv/ByteString/RightToLeft.lhs
@@ -31,7 +31,7 @@
 
 > import Text.Regex.PDeriv.RE
 > import Text.Regex.PDeriv.Pretty (Pretty(..))
-> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsGreedy(..), nub3) 
+> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsGreedy(..), nub3, minBinder, maxBinder) 
 > import Text.Regex.PDeriv.IntPattern (Pat(..), pdPat, pdPat0, toBinder, Binder(..), strip, listifyBinder)
 > import Text.Regex.PDeriv.Parse
 > import qualified Text.Regex.PDeriv.Dictionary as D (Dictionary(..), Key(..), insertNotOverwrite, lookupAll, empty, isIn, nub)
@@ -246,8 +246,8 @@
 >  case greedyPatMatchCompiled r bs of
 >    Nothing -> Right Nothing
 >    Just env ->
->      let pre = case lookup (-1) env of { Just w -> w ; Nothing -> S.empty }
->          post = case lookup (-2) env of { Just w -> w ; Nothing -> S.empty }
+>      let pre = case lookup minBinder env of { Just w -> w ; Nothing -> S.empty }
+>          post = case lookup maxBinder env of { Just w -> w ; Nothing -> S.empty }
 >          full_len = S.length bs
 >          pre_len = S.length pre
 >          post_len = S.length post
diff --git a/Text/Regex/PDeriv/ByteString/TwoPasses.lhs b/Text/Regex/PDeriv/ByteString/TwoPasses.lhs
--- a/Text/Regex/PDeriv/ByteString/TwoPasses.lhs
+++ b/Text/Regex/PDeriv/ByteString/TwoPasses.lhs
@@ -33,7 +33,7 @@
 
 > import Text.Regex.PDeriv.RE
 > import Text.Regex.PDeriv.Pretty (Pretty(..))
-> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsGreedy(..), nub2)
+> import Text.Regex.PDeriv.Common (Range, Letter, IsEmpty(..), my_hash, my_lookup, GFlag(..), IsGreedy(..), nub2, minBinder, maxBinder)
 > import Text.Regex.PDeriv.IntPattern (Pat(..), pdPat, pdPat0, toBinder, Binder(..), strip, listifyBinder)
 > import Text.Regex.PDeriv.Parse
 > import qualified Text.Regex.PDeriv.Dictionary as D (Dictionary(..), Key(..), insertNotOverwrite, lookupAll, empty, isIn, nub)
@@ -275,8 +275,8 @@
 >  case greedyPatMatchCompiled r bs of
 >    Nothing -> Right (Nothing)
 >    Just env ->
->      let pre = case lookup (-1) env of { Just w -> w ; Nothing -> S.empty }
->          post = case lookup (-2) env of { Just w -> w ; Nothing -> S.empty }
+>      let pre = case lookup minBinder env of { Just w -> w ; Nothing -> S.empty }
+>          post = case lookup maxBinder env of { Just w -> w ; Nothing -> S.empty }
 >          full_len = S.length bs
 >          pre_len = S.length pre
 >          post_len = S.length post
diff --git a/Text/Regex/PDeriv/Common.lhs b/Text/Regex/PDeriv/Common.lhs
--- a/Text/Regex/PDeriv/Common.lhs
+++ b/Text/Regex/PDeriv/Common.lhs
@@ -9,6 +9,8 @@
 >     , IsGreedy (..)
 >     , nub2
 >     , nub3
+>     , minBinder
+>     , maxBinder
 >     ) where
 
 > import Data.Char (ord)
@@ -122,4 +124,12 @@
 >                                               Nothing -> (im', x:xs')
 
 
+The smallest binder index capturing the prefix of the unanchored regex
 
+> minBinder :: Int
+> minBinder = 0
+
+The largest binder index capturing for the suffix of the unanchored regex
+
+> maxBinder :: Int
+> maxBinder = 2147483647
diff --git a/Text/Regex/PDeriv/Translate.lhs b/Text/Regex/PDeriv/Translate.lhs
--- a/Text/Regex/PDeriv/Translate.lhs
+++ b/Text/Regex/PDeriv/Translate.lhs
@@ -73,7 +73,6 @@
 >                   }
 
 
-
 > -- | Translating external pattern to internal pattern
 > translate :: EPat -> Pat
 > translate epat = case runState (trans epat) initTState of
@@ -82,9 +81,10 @@
 >                        hasAnchorE = anchorEnd state
 >                    in case (hasAnchorS, hasAnchorE) of
 >                       (True, True) -> pat -- PVar 0 [] pat 
->                       (True, False) -> PPair pat (PVar (-2) [] (PE (Star Any Greedy)))
->                       (False, True) -> PPair (PVar (-1) [] (PE (Star Any NotGreedy))) pat
->                       (False, False) -> PPair (PVar (-1) [] (PE (Star Any NotGreedy))) (PPair pat (PVar (-2) [] (PE (Star Any Greedy))))
+>                       (True, False) -> PPair pat (PVar maxBinder [] (PE (Star Any NotGreedy)))
+>                       (False, True) -> PPair (PVar minBinder [] (PE (Star Any NotGreedy))) pat
+>                       (False, False) -> PPair (PVar minBinder [] (PE (Star Any NotGreedy))) (PPair pat (PVar maxBinder [] (PE (Star Any NotGreedy))))
+>                       -- (False, False) -> (PPair (PPair (PVar (-1) [] (PE (Star Any NotGreedy))) pat) (PVar (-2) [] (PE (Star Any Greedy))))
 
 > {-| 'trans' The top level translation scheme e ~> p
 >     There are two sub rules.
diff --git a/regex-pderiv.cabal b/regex-pderiv.cabal
--- a/regex-pderiv.cabal
+++ b/regex-pderiv.cabal
@@ -1,5 +1,5 @@
 Name:                   regex-pderiv
-Version:                0.0.8.1
+Version:                0.0.8.2
 License:                BSD3
 License-File:           LICENSE
 Copyright:              Copyright (c) 2010, Kenny Zhuo Ming Lu and Martin Sulzmann
