get list'index of pattern

2018-02-08 Thread Ni Va
Hi, I got a list and would get index of item matching a pattern. index(list, string_item) works index(list, pattern_item) ?? Thank you -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visi

Replace v:val by v:key in a list if patter matches

2018-02-08 Thread Ni Va
Hi, How can I change list item's value by list index using map(. let list = ['foo', 'bar'] let pattern = 'oo' let mappedlist = [0, 'bar'] map(copy(s:xml), '(stridx(v:val,'.pattern.')>-1) ? v:key : v:val ') Thank you -- -- You received this message from the "vim_use" maillist. Do not top-

Re: get list'index of pattern

2018-02-08 Thread 'Andy Wokula' via vim_use
Am 08.02.2018 um 18:56 schrieb Ni Va: Hi, I got a list and would get index of item matching a pattern. index(list, string_item) works index(list, pattern_item) ?? match(list, pattern) -- Andy -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply belo

Re: get list'index of pattern

2018-02-08 Thread Ni Va
Thank you Andy Le 8 févr. 2018 20:57, "'Andy Wokula' via vim_use" a écrit : > Am 08.02.2018 um 18:56 schrieb Ni Va: > >> Hi, >> >> >> I got a list and would get index of item matching a pattern. >> >> index(list, string_item) works >> index(list, pattern_item) ?? >> > > match(list, pattern) > >

Re: get list'index of pattern

2018-02-08 Thread Ni Va
Le jeudi 8 février 2018 21:03:42 UTC+1, Ni Va a écrit : > Thank you Andy > > > > Le 8 févr. 2018 20:57, "'Andy Wokula' via vim_use" > a écrit : > Am 08.02.2018 um 18:56 schrieb Ni Va: > > > Hi, > > > > > > I got a list and would get index of item matching a pattern. > > > > index(lis