![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
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"; }
__________________
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! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
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 "?"
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
there's no $$$ in porn
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?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
there's no $$$ in porn
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
the servers are humming
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Too lazy to set a custom title
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&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&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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |