Community Patterns

Community Library Entry

0

Regular Expression
Created·2018-01-07 19:41
Flavor·PCRE (Legacy)

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

Description

this reg will extract:

  1. "content" of SRC
  2. "content" of ALT
  3. complete width="???"
  4. "content" of style attr.

do we really need anything else to format an image?

Submitted by anonymous