Regular Expressions 101

Community Patterns

find non-protocolized img src

0

Regular Expression
PCRE (PHP <7.3)

/
(<img (.*? )*?src=")([^:]*?)"\/
/
g

Description

Useful to expand links without a protocol header with a base url src="/bla/blubb" --> src="http:/foo.com/bla/blubb"

Submitted by fjakop - 9 years ago