Regular Expressions 101

Community Patterns

YouTube embed iframe

0

Regular Expression
PCRE (PHP <7.3)

/
<iframe[\s]+?src="(http[s]*:\/\/)?www\.youtube\.com\/embed\/([a-zA-Z0-9-_]{11})[^"]*"[^>]*?><\/iframe>
/
g

Description

Checked for 200+ <iframe> tags

Submitted by anonymous - 7 years ago