Regular expression explanation for vim

前端 未结 3 1506
旧时难觅i
旧时难觅i 2021-02-09 15:58

If I want all the lines with the text \'ruby\' but not \'myruby\' then this is what I would do.

:g/\\/

My question is what is the

3条回答
  •  情歌与酒
    2021-02-09 16:29

    For your first regular expression, you could also do:

    :g/[^\ ]ruby\ /
    

    This would ensure there was a space before and after your ruby keyword.

提交回复
热议问题