Regex pattern for image (not link) -


this question has answer here:

can give me pattern of regex local images only. :( i'm using code below includes 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 846279rr8zhg26y6.gif

if input strings bounded somehow (e.g. inside ""s or @ start of input string) things easier, , if input has semantic context of being (relative or absolute) url, , want relative urls, easier still.

i note extension part should jpe?g rather jpg , wish people never ever use bmp on webpage!


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -