正向负向后向向前看 [英] lookarounds positive negative lookbehind lookahead

查看:118
本文介绍了正向负向后向向前看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在整个Google上搜索vsvim向前或向后搜索后,并在 wiki 上,我可以似乎无法弄清楚它是如何支持前瞻性或后向性(正数或负数),以及如何使用它们.

after searching all over google for vsvim lookahead or lookbehind and on the wiki I can't seem to figure out how, or if it even supports lookahead or lookbehind (positives or negatives) and how to use them if so.

我尝试了几种不同的语法,如\ze \@=我在vim 答案上看到的(?<=let \w\+)( \(?<=let \w\+\)(,但它们似乎都无法在vs vim中使用匹配(不替换)

I've tried a few different syntaxes like \ze \@= (?<=let \w\+)( \(?<=let \w\+\)( that I've seen on vim answers but none of them seem to be working in vs vim for matching (nor substitution)

您如何在VsVim中环顾四周?

how do you do lookarounds in VsVim?

推荐答案

对于任何新手,我将在此处复制此链接的内容以备将来使用:

For any newcomers, I'll copy the contents of this link here for the future:

http://ssiaf.blogspot.ru/2009/07/negative-lookbehind-in-vim.html

/\(Start\)\@<!Date

这将与"EndDate"和"YesterdaysDate"中的"Date"匹配,但与"StartDate"不匹配

This will match the 'Date' in 'EndDate' and 'YesterdaysDate' but will not match 'StartDate'

/Start\(Date\)\@!

将与开始"中的开始"相匹配,而不与"StartDate"中的开始"相符

will match the 'Start' in 'Starting but not in 'StartDate'

/Start\(Date\)\@=

将与"StartDate"中的"Start"相匹配,而不与"Starting"中的"

will match the 'Start' in 'StartDate' but not in 'Starting

/\(Start\)\@<=Date

将与"StartDate"中的"Date"匹配,但与"EndDate"和"YesterdaysDate"中的不匹配

will match the 'Date' in 'StartDate' but not in 'EndDate' and 'YesterdaysDate'

这篇关于正向负向后向向前看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆