RE Module

tobiah st at tobiah.org
Fri Aug 25 15:17:14 EDT 2006


Roman wrote:
> I am trying to filter a column in a list of all html tags.
> 
> To do that, I have setup the following statement.
> 
> row[0] = re.sub(r'<.*?>', '', row[0])

The regex will be 'greedy' and match through one tag
all the way to the end of another on the same line.
There are more complete suggestions offered, but
it seems to me that the simple fix here is to not
match through the end of the tag, like this:

"<[^>]*>"

-- 
Posted via a free Usenet account from http://www.teranews.com




More information about the Python-list mailing list