Gruntfuggly / todo-tree

Use ripgrep to find TODO tags and display the results in a tree view
Other
1.43k stars 139 forks source link

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

Open kazmath opened 2 months ago

kazmath commented 2 months ago

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.