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

Always matching the rest of the line even when regex has a clear end point #862

Open
kazmath opened this issue Jul 20, 2024 · 0 comments
Open

Comments

@kazmath
Copy link

kazmath commented Jul 20, 2024

I have this regex here that supports multiple types of multiline comments paying attention to each of their closing expressions:

r"(([ \t]*(//+|#|;|((^|^[ ]+)(-|\*|\+)[ ]))[ ]*(-[ ]?|\*[ ]?|\+[ ]?)?(TODO)([: ][^\n]+))(\n[ \t]*(//+|#|;|((^|[ ]+)(-|\*|\+)[ ]))[ ]*([^\n]+))*)|((/\*\*?(\n[ \t*]*)?[ ]?(TODO)[\s\S]+?\*/)|(<!--[ ]?(TODO)[\s\S]+?-->)|(<!--[ ]?(TODO)[\s\S]+?-->))"

https://regex101.com/r/OxJZWP/3

I wanna specifically point out these matched lines in regex101:
image

This is how they show up in vscode when I use the exact same regex:
image

My current guess is that todo-tree seems to be using version 1.0.0 of rust's regex crate, while regex101 (as of now) is using version 1.10.3, but I'm not sure if that is quite right. If the error is on my part, please tell me.

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

1 participant