Thanks to visit codestin.com
Credit goes to github.com

Skip to content

QuotedString unquote_results doesn't understand escaped whitespace #474

Closed
@jakeanq

Description

@jakeanq

It seems that when using a QuotedString with unquote_results=True (the default), it will incorrectly expand escaped whitespace characters.

For example:

import pyparsing as pp
print(pp.QuotedString(quoteChar='"', escChar='\\').parse_string(r'"\\n"'))

Actual:

['\\\n']

Expected:

['\\n']

It works fine if I pass unquote_results=False (with the obvious downside of not unquoting the results...):

print(pp.QuotedString(quoteChar='"', escChar='\\', unquote_results=False).parse_string(r'"\\n"')

gives

['"\\\\n"']

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions