This pattern seems overly complicated. Did this come from somewhere?

A simpler version: r'<img[^>]+src="([^"]*)"'