Regular Expressions 101

Community Patterns

Image Class Test

1

Regular Expression
PCRE (PHP <7.3)

/
(<img[^>]*class=\"[^>]*\bfoo\b[^>]*\"[^>]*>)
/
ig

Description

Finds images that have a certain class (in this case, "foo")

Submitted by Todd Dukart - 8 years ago