Regular Expressions 101

Community Patterns

15

IPv4

PCRE (PHP <7.3)
no description available
Submitted by robwa - 8 years ago
106

trim

ECMAScript (JavaScript)
trim string
Submitted by fp - 10 years ago

best youtube id match ( iframe embed replace ready )

8

Regular Expression
Recommended
PCRE (PHP <7.3)

/
(?: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 - 5 years ago