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

Regex find within a file produces different results to Find in Files #12371

Closed
colinbull opened this issue Sep 21, 2016 · 3 comments
Closed

Regex find within a file produces different results to Find in Files #12371

colinbull opened this issue Sep 21, 2016 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) search Search widget and operation issues

Comments

@colinbull
Copy link

  • VSCode Version: 1.5.2, Node: 5.10.0, Shell 0.37.6
  • OS Version: Windows 7

It appears that find in files produces different results when using a regex search with new lines \n or lookbehind ?!. See the screenshot below for an example. I would have expected find in files to return a result here.

image

I am aware that find in files will omit results if the result set is too large, that is fine and to mitigate this have have specified the directory, again see screenshot.

Steps to Reproduce:

  1. Ctrl+Shift+F to open find in files
  2. Switch to regex mode
  3. Enter a regex with a newline or lookbehind, there maybe others but these are the only ones I have encountered
  4. Hit enter.

Depending on the regex you will either get a handful of results or non at all. However if you search in the file directly it will find all of the occurrences.

Cheers

Colin

@chrmarti chrmarti added the search Search widget and operation issues label Sep 21, 2016
@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Sep 21, 2016
@chrmarti
Copy link
Contributor

Could not reproduce. @colinbull Does the file use Windows line delimiters?

@colinbull
Copy link
Author

Yes the file I'm looking at does. But it has the same behaviour even if I use [\r\n]+ which is what I originally tried.

Sorry the screenshot was taken during some experimentation.

@sandy081
Copy link
Member

sandy081 commented Oct 3, 2016

@colinbull Multi-line search is not supported in Find in Files feature - See #13155

If I am not wrong, look behind expressions are not supported in javascript regex.

duplicates #13155

@sandy081 sandy081 closed this as completed Oct 3, 2016
@sandy081 sandy081 added *duplicate Issue identified as a duplicate of another issue(s) and removed bug Issue identified by VS Code Team member as probable bug labels Oct 3, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

3 participants