Vim matchstr () does not match the number in: 4:

  question, vim

let a=[‘4‘,’444444‘]
echo matchstr(get(a,0),”[0-9]\+”)
echo matchstr(get(a,1),”\d\+”)
All display empty strings

4
:s/\d\+/xxx/cg
Can be matched to 4
But {pat} in matchstr () was not successful!

My friend upstairs, the first suggestion is right.echo matchstr(get(a,0),"[0-9]\+")It is indeed empty, it is no problem