Sunday, July 1, 2012

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

You can also use Pyquery for this purpose..

On Saturday, 30 June 2012 18:07:13 UTC+5:30, mo.mughrabi wrote:
Hello, 

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
            prog
= re.compile(r'^<img')
            result
= prog.match(content)
           
print result

any suggestions?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/v0Q58xHQw7AJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment