I want to detect the src attribute of a image from the img tag from html code using python. I think regular expressions can do the job. And I created a regular expression
\<img .*src="(.*)".*/\>
But there are many possible ways to use img tag such as
<img src="images/first.png" alt="" />
<img src="images/first.png" alt="">
<img alt="" src="images/first.png" />
<img alt="" width="100" src="images/first.png" height="200">
So my question is, Is the above regular expression enough for the task ? Can any one give a better option ?