Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(http:\/\/example\.com\/.*?\/.*?\/.*?)\.png
/
g

Description

Originally used as a search and replace in database fields to change the URL strings to point to .jpg's instead of .png's. Can be used generically as a search and replace in URL's.

Submitted by anonymous - 8 years ago