 <p>Depending on exactly what you are doing, it might be easier to make a real parser.</p> <pre><code>{-# LANGUAGE FlexibleContexts #-} import Text.Parsec import Text.Parsec.Char singleQuotedStrings = many (char '\'' *&gt; many letter &lt;* char '\'') main = print $ parse singleQuotedStrings [] "'all''your''base''belong'" </code></pre>