I want to find a line starting with "abc" and ending with "xyz" in vim.
The following are the commands I tried:
:1,$g/abc[\w\W]*xyz/ :1,$g/abc\[\\w\\W\]\*xyz/ :1,$g/abc*xyz/
"[\ w \ W] *" means that the texts between "abc" and "xyz" can be any characters
"1, $" means that the search range is from the first line to the last line in the file opened by vim.
I found that the search pattern
abc[\w\W]*xyz
works at https://regex101.com/
why doesn't it work in vim?
source share