Saturday, June 30, 2012

Use regular expression to retrieve all image tags from a given content


am really a noob with regular expressions, I tried to do this on my own but I couldn't understand from the manuals how to approach it. Am trying to find all img tags of a given content, I wrote the below but its returning None

   content = i.content[0].value
= re.compile(r'^<img')
= prog.match(content)
print result

any suggestions?

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment