Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(https?\:\/\/)?(www\.)?([a-z0-9]+\.)+([a-z]{2,})(\/[a-zA-Z0-9\-_]+)+(\.)+(jpg|png|bmp|jpeg){1}
/
g

Description

check if a given url is for a img type of jpeg, jpg, bmp, png

Submitted by anonymous - 7 years ago