Skip to content

Escaping Multiple Single Quotes in Raw String Literal  #42

@zaydu98

Description

@zaydu98

Hey I noticed when trying to match a JMESPath expression that uses raw string literals with more than one escaped single quote, the matching fails. According to the proposal: https://jmespath.org/proposals/raw-string-literals.html :
"This proposal states that single quotes in a raw string literal must be escaped with a backslash."
And in the spec:
raw-string-escape = escape ("'" / escape)

When trying to match an expression with only one escaped single quote, it succeeds. If I add more than one, it fails to match but still compiles.
Example: JMESPath Expression: contains(['something\\''],a)
This returns true if a equals something'.
If I add an additional escaped single quote, matching fails.
Example: JMESPath Expression: contains(['some\\'thing\\''],a)
This should match if a equals some'thing' but does not.

Metadata

Metadata

Assignees

No one assigned

    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