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
Post a Comment