Skip to content

[\n] should not match \r\n #568

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

Closed
hamishknight opened this issue Jul 12, 2022 · 4 comments
Closed

[\n] should not match \r\n #568

hamishknight opened this issue Jul 12, 2022 · 4 comments
Assignees

Comments

@hamishknight
Copy link
Contributor

Currently [\n] matches \r\n in grapheme semantic mode, however this should not be the case.

@hamishknight hamishknight self-assigned this Jul 12, 2022
@milseman
Copy link
Member

This is open for debate as to whether we consider \n to be a literal scalar escape or some kind of newline character class.

@hamishknight
Copy link
Contributor Author

@milseman AFAIK other engines treat [\n] as equivalent to \n. We could define it differently, though that would also mean we'd also have to ban its use as a range operand e.g [\n-0]

@hamishknight
Copy link
Contributor Author

Oh hey looks like Lily already fixed this in #525, adding a couple more tests in #570

@hamishknight
Copy link
Contributor Author

Happy to re-open if we decide we want a custom matching behavior instead

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