Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-28-2010, 07:31 AM   #1
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
regex help

trying to get this youtube regex to work with /v/videoid as well as regular youtube links.

(http:\/\/)?(www\.)?(youtube\.com)?(\/)?(watch\?)?(v=)?([a-zA-Z0-9]{11})

here is the current regex suggested by borked.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 07:40 AM   #2
iwiiiiiiiiii
Outside The Box Geek
 
Industry Role:
Join Date: Oct 2004
Location: MTL/Canada
Posts: 550
You're regex seem ok, but I don't understand "to work with /v/videoid"
__________________
The second time the dog bites you, it's not his fault.
iwiiiiiiiiii is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 07:45 AM   #3
Kiopa_Matt
Confirmed User
 
Industry Role:
Join Date: Oct 2007
Posts: 1,448
I don't understand what you're trying to do. Just get the video ID? Assuming it's PHP:

Code:
if (preg_match("/\?([\w\d]+)/", $url, $match)) { 
    $video_id = $match[1];
} else { echo "No Video ID"; }
You don't need that combumbulated mess of a regex.
__________________
xMarkPro -- Ultimate Blog Network Management
Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!
Kiopa_Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 07:48 AM   #4
margarita
Confirmed User
 
Join Date: Jun 2003
Posts: 917
all this (http:\/\/)?(www\.)?(youtube\.com)?(\/)?(watch\?)?(v=)? is useless, because you've made it optional using the "?"
__________________
Check out my favourite kinky sponsor and must-have tool Nifty Stats
margarita is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 07:51 AM   #5
u-Bob
there's no $$$ in porn
 
u-Bob's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq: 195./568.-230 (btw: not getting offline msgs)
Posts: 33,063
do you need all those parts or only the video id?
u-Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 07:56 AM   #6
u-Bob
there's no $$$ in porn
 
u-Bob's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq: 195./568.-230 (btw: not getting offline msgs)
Posts: 33,063
/http:\/\/?(www\.)youtube\.com\/(watch\?v=)|(\/v\/)?([a-zA-Z0-9]{11})/

can clean it up a lot if you want
u-Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 08:05 AM   #7
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
the servers are humming
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 08:58 AM   #8
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
im trying to get the video id from these types

https://youtube.com/v/dgCrY8Mezd4

https://youtube.com/watch?v=dgCrY8Mezd4

https://youtube.com/watch?v=dgCrY...ure=grec_index

also

embed codes

Code:
<object width="640" height="385"><param name="movie" value="https://youtube.com/v/xVvRfMZ-3s4?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="https://youtube.com/v/xVvRfMZ-3s4?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-28-2010, 10:02 AM   #9
iwiiiiiiiiii
Outside The Box Geek
 
Industry Role:
Join Date: Oct 2004
Location: MTL/Canada
Posts: 550
What u-bob gave you should work.
__________________
The second time the dog bites you, it's not his fault.
iwiiiiiiiiii is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.