Community Patterns

Community Library Entry

0

Regular Expression
Created·2017-12-21 13:01
Flavor·PCRE (Legacy)

/
<img.*?src="([^"]+)".*?>
/
g
Open regex in editor

Description

<img.?src="([^"]+)".?>

Example:

preg_match_all('/<img.?src="([^"]+)".?>/', '<img src="lol"><img src="wat">', $arr, PREG_PATTERN_ORDER); Returns:

Array ( [1] => Array ( [0] => "lol" [1] => "wat" )

)

Submitted by anonymous