Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The lexer for a regex terminating character doesn't handle escapes correctly #624

Closed
Ben-Steele opened this issue Mar 13, 2023 · 1 comment

Comments

@Ben-Steele
Copy link
Contributor

JSONata version: 2.0.2
node version: 16.18.0

The Regex lexer does not properly determine if the terminating "/" of a regex is escaped. It does not consider escaped escape characters.
example:
jsonata expression - $match("test escape \\", /\\/)
result - No terminating / in regular expression
expected result - { match: "\", index: 12, groups: []}

See proposed fix in this PR: https://github.com/jsonata-js/jsonata/pull/623/files

@andrew-coleman
Copy link
Member

Resolved by #623

Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants