Regular Expressions 101

Library entries

best youtube id match ( iframe embed replace ready )

Vote

4

Regular Expression
pcre

/
(?:https?:)?(?:\/\/)?(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube(?:-nocookie)?\.com\S*?[^\w\s-])([\w-]{11})(?=[^\w-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*
/
gim

Description

Loading markdown...
Submitted by mi-ca.ch - 3 years ago