Vim - 在距行首特定偏移量处搜索带有(或不带有)字符的行 [英] Vim - search for lines with (or without) character at a specific offset from the start of a line

查看:38
本文介绍了Vim - 在距行首特定偏移量处搜索带有(或不带有)字符的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到第 78 列(该行的第 78 个字符)不是空格的所有行.

I want to find all lines where column 78 (the 78th character on the line) is not a space.

理想情况下,我想像普通搜索一样使用它.

Ideally, I'd like to use it like a normal search.

推荐答案

我想通了,留作例子,以防将来有人尝试:

I figured it out, leaving as an example in case someone tries this in the future:

如果我想匹配n"列,我只需要匹配n-1"列中的任何内容,然后对第 n 列执行我的标准.以下表达式查找第 35 列不等于空格的所有行.

If I want to match column "n", I just need to match anything of column "n-1" and then do my criteria for column n. The following expression finds all lines that have column 35 not equal to space.

^.\{34}[^ ]

这篇关于Vim - 在距行首特定偏移量处搜索带有(或不带有)字符的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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