Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-02-25 18:40
Flavor·PCRE (Legacy)

/
<img(([^>]*)srcset\=(?:\"|\')([^\"\']*)(?:\"|\'))?([^>]*)src=(?:\"|\')([^\"\']*)(?:\"|\')(([^>]*)srcset\=(?:\"|\')([^\"\']*)(?:\"|\'))?([^>]+)*>
/
g
Open regex in editor

Description

Not depending on the src or srcset order, but some matches can be empty, depending on the img syntax.

Submitted by Geoffrey Crofte & Sébastien Decamme