Regex: How to parse images not only the <img> tags -


for last whole week have been busting head find regular expression parse images in html source file. know there many out there parse tags. tricky part images in javascript , have weird long formats such :

http://pinterest.com/pin/create/button/?url=http://www.designscene.net/2015/07/binx-walton-josephine-le-tutour-vera-wang.html&amp;media=http://www.designscene.net/wp-content/uploads/2015/07/vera-wang-fall-winter-2015-patrick-demarchelier-03-620x806.jpg&amp;description=binx walton , josephine le tutour vera wang fw15 

i have tried negative heads , booleans not find solution. please give me perspective.

well said there many ways , honest there not regex solution parse html files out there.. have tried in past well. me below worked best :

/(?:.(?!http|\,))+(\.jpg|\.png) 

a bit of explanation:

/......(.jpg|.png) starts first slash finds until finds image ext . char between slash , ext (?:.(?!http|\,))+ omit if there http or , in (works charm example link have given

hope helps, regex complex world. can write same exp in many different ways. may there better solution suggest.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -