Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
PCRE (PHP <7.3)

/
(?:<iframe\s((?!src)[^=]*="[^"]*"\s){0,3}src="(?:https|http):\/\/(?!www.youtube.com\/|youtube.com\/|player.vimeo.com\/)[^"]*"[^>]*>.*?<\/iframe>)
/
gmis

Description

In (?!www.youtube.com/|youtube.com/|player.vimeo.com/) u can add good sites for iframes: www.youtube.com/ player.vimeo.com/

Submitted by Resager - 9 years ago