Thread
:
regex nightmare: anyone want to check it?
View Single Post
09-15-2009, 08:41 AM
borked
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
well, the simplest is to optionally allow each component:
(http:\/\/)?(www\.)?(youtube\.com)?(\/)?(watch\?)?(v=)?([a-zA-Z0-9]{11})
but then this means that any optional component can be left out eg:
http://v=L1BDM1oBRJ8
is valid.
__________________
For coding work - hit me up on
andy // borkedcoder // com
(consider figuring out the email as test #1)
All models are wrong, but some are useful.
George E.P. Box. p202
borked
View Public Profile
Find More Posts by borked