I have a 3000 line source code text file of a page. How I can extract specific urls similar to down below and delete rest source code ?
https://d17nygptf7ayu.cloudfront.net/photos/0b1983ccf6bb5674f93b.jpg
As I went thru code, there are 60 links similar to above link with only change in *.jpg names.
as a beginner I have least idea where to start and which tool I should use on linux command line. Also how i can do this in notepad++?
Regex I come up with https\://d17nygptf7ayu\.cloudfront\.net/photos/(?:(?!\.jpg)(?:.|\n))*\.jpg
https\://d17nygptf7ayu\.cloudfront\.net/photos/[0-9a-f]{20}.jpg
, or if you want to allow anything before the.jpg
:https\://d17nygptf7ayu\.cloudfront\.net/photos/[^\.]+.jpg