Saturday, December 24, 2011

RegExp - transform text file into html.

I have file a file full of lines starting with #, sometimes a single
line, sometimes multiple lines. They are followed by a snippet of
code. Here's part of such a file:

http://pastebin.com/w7zL45GM

I want to to insert <p> and </p> before and after vim paragraphs in
paragraphs that start with #. So far I have:

%s/^#\(.*\_s.*\)/<p>\1<\/p>/

But it is still messy. I hope someone helps me improve this regex.


Thanks in advance.

--
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

No comments: