Regular Expressions 101

Community Patterns

Find image html tags without alternative text

1

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

This regex finds images html tags without alternative text

Submitted by anonymous - 14 days ago