Forked from nasamuffin/vim-regexp-verymagic-cheatsheet.txt
Created
March 20, 2022 01:38
-
-
Save sisrfeng/2f9a725d4bcfaab42cb0fdd6846cfeee to your computer and use it in GitHub Desktop.
Cheatsheet for vim regex with \v specified.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Special matching strings | |
==== | |
^ Start of line | |
$ End of line | |
. Any character | |
~ Match last given substitute string | |
[...] Match range | |
[^...] Not range | |
< Beginning of a word | |
> End of a word | |
_. Any single character OR EOL | |
Control strings | |
==== | |
\ Escape next character | |
(...) Capture group | |
| Separate alternative | |
Replacement strings | |
==== | |
& Insert entire matched pattern (equivalent to \0) | |
\n Insert capture group n | |
Quantifiers | |
==== | |
* 0 or more quantifier | |
+ 1 or more quantifier | |
= 0 or 1 quantifier | |
? 0 or 1 quantifier | |
{n,m} n to m quantifier | |
{n} n quantifier | |
{n,} at least n quantifier | |
{,n} up to n quantifier | |
Lookaround | |
==== | |
@<= positive lookbehind | |
@<! negative lookbehind | |
@= positive lookahead | |
@! negative lookahead |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment