Jump to content

Help and I'll post boobs


waynew

Recommended Posts

I'm a guy so you must feel pretty gay right now.

 

Anyway. Question is: does anyone have some sort of regex solution for validating Youtube URLs? Not the embed code, just the URL of the video.

 

I reckon this is the kind of pattern that it must match. I'm hopeless at regex so I'd be very grateful if someone could help?

 

http://(country-specific-subdomain).youtube.com?(GET variables)

Link to comment
https://forums.phpfreaks.com/topic/153630-help-and-ill-post-boobs/
Share on other sites

well, you could do this:

 

~http://[^\.]*\.youtube\.com.*~

 

that would validate http://[anythinghere].youtube.com[anythingafter]

 

If you have a list of specific subdomains you want to allow, you could do

 

~http://(a|b|c)\.youtube\.com.*~

 

where a b c is replaced by the specific subdomains (list all allowed ones in there, separating them with the pipe)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.