extract link using regex | SoloLearn: Learn to code for FREE!

-1

extract link using regex

i have some images links that i extracted from a html using following regex :- ([a-zA-Z\-_0-9\/\:\.]*\.(jpg|jpeg|png|gif)) Here is the image urls :- (Notice that image name of few images is same but have different resolutions. So, write a regex to extract only one image which have high resolution https://www.jamuitoday.com/wp-content/uploads/2020/06/IMG-20200607-WA0028-300x150.jpg https://www.jamuitoday.com/wp-content/uploads/2020/06/IMG-20200607-WA0028-300x150.jpg https://www.jamuitoday.com/wp-content/uploads/2020/06/IMG-20200607-WA0028-768x384.jpg https://www.jamuitoday.com/wp-content/uploads/2020/06/IMG-20200607-WA0028.jpg https://www.jamuitoday.com/wp-content/uploads/2020/05/20200530_173823-300x225.jpg https://www.jamuitoday.com/wp-content/uploads/2020/05/20200530_173823-300x225.jpg https://www.jamuitoday.com/wp-content/uploads/2020/05/20200530_173823-768x576.jpg https://www.jamuitoday.com/wp-content/uploads/2020/05/20200530_173823.jpg https://www.jamuitoday.com/wp-content/uploads/2020/07/IMG-20200703-WA0004-300x180.jpg https://www.jamuitoday.com/wp-content/uploads/2020/07/IMG-20200703-WA0004-300x180.jpg https://www.jamuitoday.com/wp-content/uploads/2020/07/IMG-20200703-WA0004-768x461.jpg https://www.jamuitoday.com/wp-content/uploads/2020/07/IMG-20200703-WA0004-1024x614.jpg https://www.jamuitoday.com/wp-content/uploads/2020/07/IMG-20200703-WA0004-940x560.jpg https://www.jamuitoday.com/wp-content/uploads/2020/07/IMG-20200703-WA0004.jpg https://www.jamuitoday.com/wp-content/uploads/2015/12/advertis-300x54.jpg https://www.jamuitoday.com/wp-content/uploads/2015/12/advertis-300x54.jpg https://www.jamuitoday.com/wp-content/uploads/2015/12/advertis-768x139.jpg

7/15/2020 5:30:27 AM

Manjit Kumar

11 Answers

New Answer

0

Where is the resolution data? eg. https://www.jamuitoday.com/wp-content/uploads/2020/05/20200530_173823.jpg

0

Calviղ there is no seperate resolution data... There are just links.. which have resolution already written in them.

0

Manjit Kumar Check your img links again.. Not all links have resolution written on them.

0

Manjit Kumar If ignore the links that don't have resolution data, here the code for you study in JS: https://code.sololearn.com/WUY6VS7gOcZO/?ref=app

0

Calviղ Let's go for the links which don't have resolution mentioned... And can you write it in any other language like java , python , c++

0

Manjit Kumar I don't know java, python, c++, c#, c...

0

Calviղ Oh... Then , write the regex and program in js.

0

Manjit Kumar 👆

0

Calviղ i mean to find the links which don't have resolution written in them.

0

Manjit Kumar The question seems differently from what I read initially 🧐Why? Anyway, you can modify my code to find the images, it's almost there. I better dont spoon feeding fully, leave you room to learn by changing the code.