todo-tree icon indicating copy to clipboard operation
todo-tree copied to clipboard

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

Open kazmath opened this issue 7 months ago • 0 comments

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.

kazmath avatar Jul 20 '24 04:07 kazmath