Vim Techniques 18 - Lookaround (Lookahead & Lookbehind) Regex

Опубликовано: 18 Июнь 2026
на канале: haxpor
995
12

Let's get to know about Lookahead & Lookbehind which are collectively called as Lookaround for vim regex search.


This might be one of regex technique that we overlook. It can be used with other vim commands e.g. :%s (substitution), :g (global command), :vimgrep, etc so it's naturally blended into vim ecosystem.


-- Chapters --
0:00 Introduction
1:20 1st Example - Positive Lookbehind
4:48 Perl's lookaround syntax reference
07:29 2nd Example - Positive Lookbehind & Lookahead
12:03 2nd Example (with :g command)
14:15 3rd Example - Multi-lines Positive Lookbehind & Lookahead
18:40 Effect of regex's greedy search
20:07 Non-greedy syntax in vim
22:17 3rd Example (with :%s command)
24:42 Note for \n and \r usage in vim
24:55 3rd Example (with :vimgrep command)
25:55 Closing


#vim #vimtechniques


-- Follows Wasin on socials --
Website: https://wasin.io
Twitter: @haxpor
LinkedIn:   / wasinthonkaew  
Github: https://github.com/haxpor