Hi epanda!

On Di, 16 Mär 2010, epanda wrote:

> I am searching for the smarter method to Feed an entry of my Dict with
> submatches of a String
> 
> 
> let myString = "myPath\" . "foo" . "\nameOfFile.ext"
> 
> let myDict= {}
> echo substitute(myString , '\(.*\)\\foo\\\(.*\)', "\1 \2", "")
> 
> Meanwhile doing "\1 \2", I would like todo
> 
> let  myDict[\1] = \2    "if myDict[\1] does not exist
> 

I am not sure, if the following works for you. But my first thought was 
to use split:

let myList=split(myString, '\\')
let myDict[myList[0]] = myList[2]

Obviously, this depends on the levels of directories, whether this works 
well enough for you.

regards,
Christian
-- 
Hülsenfrucht zum Abendbrot, morgens sind die Fliegen tot.

-- 
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, visit http://www.vim.org/maillist.php

Reply via email to