Regular Expressions 101

Community Patterns

YouTube Iframe parser

2

Regular Expression
PCRE (PHP <7.3)

/
<iframe [^>]*?src=\"https?:\/\/(?:www\.)?youtu(?:be)?\.(?:com|be)\/(?:embed|watch)\/([^\?]*?)\?[^>]*?>\s*<\/iframe>
/

Description

no description available

Submitted by anonymous - 8 years ago