Vim regexp: Backreferences

Опубликовано: 07 Август 2026
на канале: learnbyexample
274
5

Grouping a pattern using `\(pattern\)` are also known as capture groups. The string captured by these groups can be referred later using backreference `\N` where `N` is the capture group you want. Backreferences can be used in both search/replacement sections. You can make a grouping non-capturing by using `\%(pattern\)` (i.e. adding a `%` prefix).

This video is based on my "Vim Reference Guide" ebook: https://github.com/learnbyexample/vim...