Questions tagged [match]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
39 views

Interaction between zero-width matchers and backreferences

Take a file with the following text as a workbench. hello world hello world With the cursor at the beginning of the line, here's how \1 interacts with \(…\), \@=, and \@! # regex matched text text ...
Enlico's user avatar
  • 2,184
1 vote
1 answer
49 views

Syntax highlighting of a submatch

I have the following syn match specialNumber /1/ contained syn match normalNumber /\d/ contained syn match line /^\d$/ contains=specialNumber,normalNumber hi def link ...
xvf99680's user avatar
1 vote
1 answer
52 views

How to delete match group?

Say I called: matchadd('my_group', 'regex1') and: matchadd('my_group', 'regex2') I know I could matchdelete() on id, but how could we delete match of my_group?
Qiu Yangfan's user avatar
0 votes
1 answer
51 views

What is the shortest search pattern that matches nowhere?

This is mostly a curiosity-driven question. I can't think of anything shorter than x\@=y, which tries to match x and y at the same position. A slightly longer, but probably more self-explaining ...
Enlico's user avatar
  • 2,184
0 votes
0 answers
47 views

Matchpairs not working?

I'd like to match pairs in nvim and have the following code: vim.opt.matchpairs:append("❪:❫") vim.opt.matchpairs:append("⟮:⟯") vim.opt.matchpairs:append("❨:❩") However, ...
Alois Pichler's user avatar
0 votes
2 answers
96 views

How can copy the matched string into register +?

For the below data: -150000 2023-03-30 421.67 2023-04-20 575 2023-05-20 I can substitute the whole line with the first string :%s/\v.{-1,}\s+(.+)/\1 Then the content was changed into: -...
showkey's user avatar
  • 1,120
0 votes
3 answers
44 views

Replace all occurrences of ' 1 ' with matched text in one line

I've got a text file, containing following lines <a href="tg://proxy?server=radan.rooznameh.etellaate.rooz.romatism.sbs&port=443&secret=...
wl2776's user avatar
  • 360