GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   any idea why this regex isnt matching google plus links? (https://gfy.com/showthread.php?t=1101254)

fris 02-26-2013 06:26 AM

any idea why this regex isnt matching google plus links?
 
Code:

https://youtube.com/watch?v=g_7AUFJNq5w (works)
https://youtube.com/v/g_7AUFJNq5w (works)
https://youtube.com/embed/g_7AUFJNq5w (works)
http://youtu.be/g_7AUFJNq5w (works)
http://plus.google.com/posts/FwCpHkqGxR1 (doesnt work)

%^(?:https?://)?(?:www\.)?(?:youtu\.be/|plus\.google\.com|youtube\.com(?:/embed/|/posts/|/v/|/watch\?v=))([\w-]{10,12})$%x


Deputy Chief Command 02-26-2013 06:31 AM

arent you supposed to be the wordpress guru on here?

you know how to solve this? https://gfy.com/showthread.php?t=1101248

fris 02-26-2013 06:47 AM

Quote:

Originally Posted by Deputy Chief Command (Post 19500981)
arent you supposed to be the wordpress guru on here?

you know how to solve this? https://gfy.com/showthread.php?t=1101248

replied ;)

fris 02-26-2013 06:53 AM

solved it ;)

Code:

%^https?://(?:www\.)?(?:youtube\.com|youtu\.be|plus\.google\.com)/(?:watch\?v=|v/|embed/|posts/|)((?:[\w_]{10,12}))$%

Deputy Chief Command 02-26-2013 07:09 AM

Quote:

Originally Posted by fris (Post 19500999)
replied ;)

cool, thanks

fris 02-26-2013 09:32 PM

for anyone who is intersted ;)

urls it matches

https?://(?:www\.)?(?:youtube\.com|youtu\.be|plus\.google\. com)/(?:watch\?v=|watch\?.+&v=|user/[^/]+?#p/\w/\w/\w/|v/|embed/(?:watch\?feature=player_embedded&v=)?|\+youtube/posts/|)((?:[\w-]{11}))

needed to intercept the wordpress oembed, to replace it with a custom html5 player that uses the youtube api, along with my own code to use animated youtube thumbnails.

:pimp

EddyTheDog 02-26-2013 09:41 PM

Quote:

Originally Posted by fris (Post 19502513)
for anyone who is intersted ;)

urls it matches



https?://(?:www\.)?(?:youtube\.com|youtu\.be|plus\.google\. com)/(?:watch\?v=|watch\?.+&v=|user/[^/]+?#p/\w/\w/\w/|v/|embed/(?:watch\?feature=player_embedded&v=)?|\+youtube/posts/|)((?:[\w-]{11}))

needed to intercept the wordpress oembed, to replace it with a custom html5 player that uses the youtube api, along with my own code to use animated youtube thumbnails.

:pimp

Sounds interesting - If you are doing what I think you are....


All times are GMT -7. The time now is 11:31 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123