Regular Expressions 101

Community Patterns

0

PLP redirection

PCRE2 (PHP >=7.3)
PLP redirection
Submitted by anonymous - 15 hours ago
1

loyal

PCRE2 (PHP >=7.3)
loyal
Submitted by anonymous - 5 days ago
1

named capture

PCRE2 (PHP >=7.3)
simple named capture
Submitted by Gene - 6 days 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