Regular Expressions 101

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(<img(?!.*?alt=(['"]).*?\2)[^>]*)(>)
/
gm

Description

This regex finds images html tags without alternative text

Submitted by anonymous - 7 months ago