-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
regex end-of-line search is broken #36309
Comments
Oh, I see this on Windows. It's actually matching the CR line ending. Ripgrep has this behavior as well. Need to check how we actually avoid this in the editor... Cheap workaround - avoid matching \r with something like |
What tool do you use for search with this regex? I see the same behavior in Sublime. |
it doesn't really matter or not this agrees with some other tool. it doesn't agree with itself - the in-file search rules should be the same as the many-file rules. |
Ideally, but there are two regex engines in play that will not agree in a few cases. It's interesting that
|
yeah, can we have an option so it only uses one regex engine? again, i don't care if it's slow. |
I forgot that you said this happens regardless of |
See also: BurntSushi/ripgrep#416 and rust-lang/regex#244 This particular type of match semantics varies wildly among regex engines. Some don't consider IIRC, GNU grep does something akin to normalizing line endings before executing a search, but it is quite complex. (That probably explains why A shot in the dark here is that if your editor is doing line ending normalization (or something), then that may be why there's an inconsistency? |
Yeah the editor does normalize lines and essentially joins them with How do we match this behavior by rewriting the regex? I think that in single line mode, we would just rewrite |
Working on this... I will remap |
Steps to Reproduce:
this occurs regardless of "search.useRipgrep" setting.
Reproduces without extensions: Yes
seriously, can we please get a version of 'Find in Files' that's not completely broken, uses the same regex matching as the in-file matching. i don't care if it's slow, i just want correct results. as it is, I have to open up another tool to do regex search/replace because VScode's feature is so broken.
The text was updated successfully, but these errors were encountered: