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

Cannot use captured groups in replace when searching a regex that contains multiple lines (\n) #63518

Closed
SebLz opened this issue Nov 20, 2018 · 3 comments
Assignees

Comments

@SebLz
Copy link

SebLz commented Nov 20, 2018

  • VSCode Version: 1.29.1
  • OS Version: Win 7 x64

It seems that when we search in multiple files using a regex that contains the "\n" sequence, we cannot use the captured groups in the replace field:

Steps to Reproduce:

Multiline search with **non-**working replace ($1 & $2 are not replaced by their corresponding group)
image

Multiline search with working replace ($1 & $2 are correctly replaced by their corresponding group)
image

@vscodebot
Copy link

vscodebot bot commented Nov 20, 2018

@SebLz
Copy link
Author

SebLz commented Nov 20, 2018

This does not seem to be a duplicate of any of the bugs above. The example above contains a rather long regex, but even with very simple ones you can verify that the replace is broken as soon as a \n is in the regex:

  • (.+) : $1 replace will work
  • (.+)\n : $1 replace won't work

@roblourens
Copy link
Member

This looks like a duplicate of #62980 - should be fixed in Insiders

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants