Or perhaps more generically: >>> import re >>> string = 'scatter "http://wwww.yahoo.com quotes and text anywhere www.google.com" "www.bing.com" or not' >>> print re.findall(r'(?:http://|www.)[^"\s]+',string) ['http://wwww.yahoo.com', 'www.google.com', 'www.bing.com']