Re: difference between submatch(1) and \1 intended?

2017-11-27 Fir de Conversatie Christian Brabandt
On Fr, 24 Nov 2017, Ingo Karkat wrote: > On 24-Nov-2017 15:13 +0100, Christian Brabandt wrote: > > > > On Fr, 24 Nov 2017, Marius Gedminas wrote: > > > >> On Fri, Nov 24, 2017 at 11:30:03AM +0100, Christian Brabandt > >> wrote: > >>> Hi, while writing the test for checking the URLs I stumbled o

Re: difference between submatch(1) and \1 intended?

2017-11-24 Fir de Conversatie Ingo Karkat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 24-Nov-2017 15:13 +0100, Christian Brabandt wrote: > > On Fr, 24 Nov 2017, Marius Gedminas wrote: > >> On Fri, Nov 24, 2017 at 11:30:03AM +0100, Christian Brabandt >> wrote: >>> Hi, while writing the test for checking the URLs I stumbled on >>>

Re: difference between submatch(1) and \1 intended?

2017-11-24 Fir de Conversatie Christian Brabandt
On Fr, 24 Nov 2017, Marius Gedminas wrote: > On Fri, Nov 24, 2017 at 11:30:03AM +0100, Christian Brabandt wrote: > > Hi, > > while writing the test for checking the URLs I stumbled on this > > difference between submatch(1) and \1: > > #v+ > > let a = 'https://www.vim.org ' > > let g:pat =

Re: difference between submatch(1) and \1 intended?

2017-11-24 Fir de Conversatie Marius Gedminas
On Fri, Nov 24, 2017 at 11:30:03AM +0100, Christian Brabandt wrote: > Hi, > while writing the test for checking the URLs I stumbled on this > difference between submatch(1) and \1: > #v+ > let a = 'https://www.vim.org ' > let g:pat = '.\{-}\(http[^ ]*\).\{-}$' > echo substitute(a, g:pat, sub

difference between submatch(1) and \1 intended?

2017-11-24 Fir de Conversatie Christian Brabandt
Hi, while writing the test for checking the URLs I stumbled on this difference between submatch(1) and \1: #v+ let a = 'https://www.vim.org ' let g:pat = '.\{-}\(http[^ ]*\).\{-}$' echo substitute(a, g:pat, submatch(1), '') echo substitute(a, g:pat, '\1', '') #v- If you execute this piece o