Regular Expressions 101

Community Patterns

HTML Image Regex

0

Regular Expression
Java 8

"
/asmproxy/([a-zA-Z_/]+.(gif|jpg))
"
gm

Description

This code will find image files with .gif and .jpg extensions which are present in a HTML or CSS code. Here I am using the prefix '/asmproxy/' to identify the resource and then checking if extension ends with a .gif or .jpg. This Regex has its limitations as we are using prefix.

Submitted by Suman Mummaneni - a year ago