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

Global search and replace with regexp containing newlines does not substitute variables #62980

Closed
aardappel opened this issue Nov 13, 2018 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug search-replace Search and replace issues verified Verification succeeded
Milestone

Comments

@aardappel
Copy link

  • VSCode Version: 1.29.0
  • OS Version: Linux / Ubuntu

Supposedly this issue was fixed in #9010 (which is now locked), but it is not working for me still.

Steps to Reproduce:

  1. Use a global search regexp pattern with group occurrences such as (.*)
  2. Refer to them in the pattern with $1 etc.
  3. Notice in the preview (double click on result) it shows $1, not the matched substring.

It could well be that it is a preview issue, did not try to actually execute the replacement.
Also my regexp was multi-line, if that matters (matching \n in places outside the groups).

@cleidigh cleidigh added the search-replace Search and replace issues label Nov 13, 2018
@roblourens
Copy link
Member

Can you share the exact regex search/replace? This works for me

@roblourens roblourens added the info-needed Issue requires more information from poster label Nov 13, 2018
@roblourens
Copy link
Member

Actually I see, it does fail with multiline strings.

@roblourens roblourens self-assigned this Nov 13, 2018
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release and removed info-needed Issue requires more information from poster labels Nov 13, 2018
@roblourens roblourens added this to the October 2018 Recovery milestone Nov 13, 2018
roblourens added a commit that referenced this issue Nov 14, 2018
This reverts commit e97f612.
@roblourens roblourens reopened this Nov 14, 2018
@aardappel
Copy link
Author

Ah I see you were able to reproduce. Sorry for not giving an example earlier.

@aardappel aardappel changed the title Global search and replace with regexp does not always substitute variables Global search and replace with regexp containing newlines does not substitute variables Nov 14, 2018
@roblourens roblourens reopened this Nov 14, 2018
@roblourens roblourens removed the candidate Issue identified as probable candidate for fixing in the next release label Nov 15, 2018
@roblourens
Copy link
Member

Pulling this from the recovery milestone. This is unfortunate but I think it's sort of a niche issue. The fix is in Insiders already if anyone needs this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug search-replace Search and replace issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants