Friday 15 February 2019

Regex pattern for image (not link)

Can anyone give me the pattern of the regex to get all the local images ONLY. :(
I'm using the code below but it includes the image links.




  Regex rgx = new Regex("[^\\/:*?\"<>|]+\\.(?i)(jpg|png|gif|bmp)", RegexOptions.IgnoreCase);


input:



 http://dl9.glitter-graphics.net/pub/846/846279rr8zhg26y6.gif
images/strawberries.jpg


output:




 846279rr8zhg26y6.gif
strawberries.jpg


I don't want the 846279rr8zhg26y6.gif

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...