Hi,
I need to use a pattern to detect some field in lines :
The pattern is that one :
let pattern = '"{\"\\(\\w\\+\\)\"\\s\\+,\\(\\d\\+\\)\\s\\+,\\d\\+\\s\\
+,\\(\\w\\+\\)\\s\\+,\\(\\w\\+\\)\\s\\+,.*\\{,\\d\\+\\s\\+}.*$"'
call map(myList,'substitute(v:val, ' . pattern .
', "<item>\\n<reference>\\2</reference>\\n<type>\\4</type>\
\n<valeur>0</valeur>\\n<description>\\1</description>\\n</item>",
"")')
1/ I would like avoiding to put double backslash in order the pattern
works under double call map( and substitute( funcs.
2/ And can I simplify the final result sentence or assign it to a
variable before calling substitute( func ?
3/ Finally, I have noticed that the <item>\\n insert well a newline
when I do
tabnew
put = myList
BUT if I use writefile(myList , ... b) and then open the file, the
newline is not interpreted.
Thank for help
--
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
To unsubscribe, reply using "remove me" as the subject.