Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %s/,//gn
- function! Count( word )
- redir => cnt
- silent exe '%s/' . a:word . '//gn'
- redir END
- let res = strpart(cnt, 0, stridx(cnt, " "))
- return res
- endfunction
- a,bc
- akj,dh
- jlkdfa,
- oiua ,lkj
- oiua, lkj
- oiua , lkj
- i,
- function! Count( word )
- redir => cnt
- silent exe '%s/' . a:word . '//n'
- redir END
- return matchstr( cnt, 'd+' )
- endfunction
- function! MyMatch()
- let results = ingo#text#frompattern#Get(1, '$', 'jw{1,5} zs(loc|lab)_w+ze', '', '', '1')
- let counter=1
- for result in results
- if Count(result) != 2
- execute '%s/' . result . '/label' . counter . '/g'
- let counter+=1
- endif
- endfor
- endfun
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement