Regular Expressions 101

Community Library

Your search did not match anything

Community Library Entry

0

Regular ExpressionOpen Workspace

/
(images\/.+)((?<!no-compress)\.png|\.jpeg|\.jpg|\.PNG|\.JPEG|\.JPG)
/
gm

Description
Created·2022-07-02 14:40
Type·Substitution
Flavor·PCRE2 (PHP)

o let's imagine this here:

images/dwaudhawd_Test Picture.png

I would need to replace this into this:

images/dwaudhawd_Test Picture.webp

the thing you just have to pay attention is, to ignore all filenames that contains "no-compress".

so when this here comes:

images/dwaudhawd_Test Picture no-compress.png

it should not replace.

all possible image extensions:

.jpeg .jpg .png .JPEG .JPG .PNG

into

.webp

Submitted by Suman Maharjan
Open Workspace