pp.sglQuotedString is a parser
that matches a string enclosed in single-quote
'”) characters. The
\'” within the text
is not interpreted as an internal
>>> text = "'Do I get wafers with it?'" >>> print pp.sglQuotedString.parseString(text) ["'Do I get wafers with it?'"] >>> escaper = "'Don\\'t'" >>> print escaper 'Don\'t' >>> result = pp.sglQuotedString.parseString(escaper) >>> print result 'Don\'t'
"\'" sequences were interpreted
as escapes, the last line above would have displayed as: