![]() |
Regex assistance {Thank you, advance}
Hello, i am working on a kind of link site, you can share youtube links. In basic, it is like this you login as a user and upload a link or multi links. So the problem is that i want to validate that it is a youtube link.
all info you can provide on this would be great, and please do not share regex reference links or so beacuse it wont get me anywhere as its hard to understand :P oh well.. Thank you in advance! ^^ |
1 Attachment(s)
There are obviously people who are better than me with regular expressions, but here's my attempt, and it appears to work well:
PHP Code:
|
thank you this is what i came up with '~^http://[a-z]{2,3}\.youtube\.com/\?v=[\w-]+(?:&feature=related)?$~i' for like 5 hours ago but the one you made seems better,
gah regex.. :P |
You have to also take in account that my youtube links end with .ca instead of .com.
|
| All times are GMT. The time now is 04:37 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0