> It works but seems a bit messy. Is there a neater way to do this ? Yes use the html parser module. There is some sample code that shows how to strip all tags to get plain text from an html file. And your code is less reliable(tags spanning lines, nested tags etc) than the html parser code... Alan G.