Pyparsing includes a sample program for extracting URLs from web pages. You should be able to adapt it to this problem. Download pyparsing at http://pyparsing.sourceforge.net -- Paul