PracticalVim Tip77 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 77: Stake the Boundaries of a Match

Return to the top: <>

  • `\zs`: marks the start of a match
  • `\ze`: marks the end of a match

References:

Lookaround Expressions

* `\zs` is roughly equivalent to positive lookbehind * `\ze` is equivalent to positive lookahead.
  • Vim also supports the full matrix of negative/positive lookahead/lookbehind assertions, but the syntax differs from Perl.

References:

Example: Rewrite

using Vim’s positive lookaround items

⚠️ **GitHub.com Fallback** ⚠️