(I found the whole thread was removed when my intention was to modify
my reply, by "removing" and "posting" again ... Now, I tried to
recover some based on my Vim buffer)
Wow, Tony, you can come up a working function without being tested!
Quick test showed both worked:
ExpandPattern('\a') =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
ExpandPattern('\l') = 'abcdefghijklmnopqrstuvwxyz'
The correct syntax to get String 'abcdefghijklmnopqrstuvwxyz' is:
join(map(range(char2nr('a'),char2nr('z')),'nr2char(v:val)'),'')
Thanks to Tony and Ag for inspiration!
Sean
PS: Tony's function
function ExpandPattern(pattern)
let res = ""
let i = 0
while i < 256
let x = nr2char(i)
if x =~ a:pattern
let res .= x
endif
let i += 1
endwhile
return res
endfunction
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---