Questions tagged [matchlist]
The matchlist tag has no usage guidance.
3
questions
1
vote
2answers
116 views
Why does matchlist() return empty strings at the end of the result?
From the Vim's help:
echo matchlist('acd', '\v(a)?(b)?(c)?(.*)')
Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', '']
I understand why the 3rd element is an empty string: 'b' is not present in ...
0
votes
1answer
54 views
How to express an unicode code points set in match command?
My test.txt for this example.
unicode 3000 (whitespace in Chinese mark)
! unicode ff01
^ unicode ff3e
~ unicode ff5e
The command can match whitespace in Chinese mark(u3000).
hi! ...
2
votes
1answer
180 views
How to anchor matchlist after searchpos?
I'm trying to find words before the cursor using searchpos, then use matchlist to get the captures. I can't find a reliable way to anchor the pattern for matchlist. For example, if the cursor is ...