regexec :: Regex      -- ^ Compiled regular expression
        -> Rope -- ^ Rope to match against
        -> Either String (Maybe (Rope, Rope, Rope, [Rope]))
regexec r rope =
    case matchOnceText r rope of
        Nothing -> Right (Nothing)
        Just (pre,mt,post) ->
            let main = fst (mt!0)
                rest = map fst (tail (elems mt)) -- will be []
            in  Right (Just (pre,main,post,rest))
regexec :: Regex      -- ^ Compiled regular expression
        -> Rope -- ^ Rope to match against
        -> Either String (Maybe (Rope, Rope, Rope, [Rope]))
regexec r rope =
    case matchOnceText r rope of
        Nothing -> Right (Nothing)
        Just (pre,mt,post) ->
            let main = fst (mt!0)
                rest = map fst (tail (elems mt)) -- will be []
            in  Right (Just (pre,main,post,rest))
regexec r rope =
    case matchOnceText r rope of
        Nothing -> Right (Nothing)
        Just (pre,mt,post) ->
            let main = fst (mt!0)
                rest = map fst (tail (elems mt)) -- will be []
            in  Right (Just (pre,main,post,rest))