Match parenthesised block using regular expressions in vim

后端 未结 4 619
终归单人心
终归单人心 2020-12-03 22:14

I\'m trying to match the contents that belong between a certain ( and its matching ) as found by vim when using the motion %.

4条回答
  •  离开以前
    2020-12-03 22:41

    As Jens told, this cannot be done with Vim regular expressions.

    However if you want to do some special processing you can possibly do the following:

    • Find opening parentheses that interest you and then run a macro that will insert some character (let's say ^@) after the opening parenthese and before the closing parenthese using the % binding.
    • Then modify the regex accordingly.

提交回复
热议问题