Am 10.10.2019 um 10:44 schrieb Ni Va:
> Don't understand why it returns 2 first chars on this example :
>
> + 20191009_191004_Vim.8.1.2125/ 4.0 KiB [D] 2019-10-
> echo substitute(getline(line('.')),'^..\zs\(.\+\)\(\s\+\d\+\.\d\+\)\@=.*$','\1', "") returns + 20191009_191004_Vim.8.1.2125/
The match starts after `\zs', what comes before is not substituted.
I wonder why the greedy \(.\+\) does not include any spaces.
Looks like \(\s\+\d\+\.\d\+\)\@= is checked before any backtracking takes place.
"no backtracking" => actually this depends on re=0 or re=2.
:echo substitute(getline('.'), '^..\(.\{-}\)\s\+\d\+\.\d\+.\{,20}$', '\1', '')
--
Andy