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

Make \zs and \ze work in Vim search to only include substring of match #3073

Closed
elmewo opened this issue Sep 24, 2018 · 3 comments
Closed

Make \zs and \ze work in Vim search to only include substring of match #3073

elmewo opened this issue Sep 24, 2018 · 3 comments

Comments

@elmewo
Copy link

elmewo commented Sep 24, 2018

Is your feature request related to a problem? Please describe.
When using the Vim search you are usually able to include only a part of the match as search result. This is not possible in VSCodeVim, yet.
Example from Practical Vim:
/\v\<\/?h\zs\d
This finds all digits in html heading tags as in

<h2>Heading number 1</h2>
<h3>Number 2 heading</h3>
<h4>Another heading</h4>

.

Describe the solution you'd like
I'd like to see the vanilla Vim regex engine behaviour here, because this is an essential feature for pattern search.

@jwmann
Copy link

jwmann commented Apr 30, 2019

\zs and \ze are literally my favourite components to vim regexp
Unfortunately I think they don't work because VSCodeVim uses regular Javascript for its regexp engine (according to #991), which iirc doesn't have the ability for \zs and \ze

@jwmann
Copy link

jwmann commented May 3, 2019

I found a way to do something similar to \zs and \ze
Check this out for reference: https://javascript.info/regexp-lookahead-lookbehind

@J-Fields
Copy link
Member

Closing in favor of #3996

@J-Fields J-Fields changed the title Make \zs and \ze work in Vim search to only include substring of match Make \zs and \ze work in Vim search to only include substring of match Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants