Closed jamesls closed 9 years ago
When using a raw string literal ('foobar'), escaping the single quote results in the \ char still present in the output. For example:
'foobar'
\
import jmespath print(jmespath.compile(r"'foo\'bar'")) # prints: {'type': 'literal', 'children': [], 'value': "foo\\'bar"}
The expected result should be the single quote without the escaped char:
{'type': 'literal', 'children': [], 'value': "foo'bar"}
Consider the case when using double quotes or literals. Both of these handle escaping the delimiting character:
print(jmespath.compile(r'"foo\"bar"')) # prints: {'type': 'field', 'children': [], 'value': u'foo"bar'} print(jmespath.compile(r'`foo\`bar`')) {'type': 'literal', 'children': [], 'value': u'foo`bar'}
When using a raw string literal (
'foobar'
), escaping the single quote results in the\
char still present in the output. For example:The expected result should be the single quote without the escaped char:
Consider the case when using double quotes or literals. Both of these handle escaping the delimiting character: