Christian Brabandt wrote: > PS: Anybody knows why map(getline(1,"$"), 'matchstr(v:val, > "^\\d\\+")') worked, but not map(getline(1,"$"), > "matchstr(v:val, '^\d\+')"), which would have the benefit of > not having to double escape the regular expression, thus > looking clearer?
Amazing piece of code! Re the nested quotes, I think that in "...'^\d\+'..." the apostrophes are not special, so the backslashes are interpreted as would be done in any "..." string. For example, this command: :echo "a'\t'b" outputs: a' 'b You could use (note the double apostrophes): map(getline(1,'$'), 'matchstr(v:val, ''^\d\+'')') John --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
