I tried something like this but failed. I don't know regex can anyone help me with this?
import re
html = """
<body>
<h1>dummy heading</h1>
<img src="/pic/earth.jpg" alt="planet" width="200">
<img src="/pic/redrose.jpg" alt="flower" width="200">
</body>
"""
x = re.search('^src=".*jpg$', html)
print(x)
I'm expecting output like this ['/pic/earth.jpg','/pic/redrose.jpg']