ciao a tutti, sapete indicarmi una funzione asp capace di estrarre il solo codice del video da un url di youtube del tipo
estrai("http://www.youtube.com/watch?v=d-YCvAG-0Ig&feature=popular")
che restitusca "d-YCvAG-0Ig"
grazie a tutti
ho provato con
[code]
Function estrai(stringa)
Dim objRegExp, strTemp
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "/^v=([0-9A-Za-z-_]{11})/"
Set Matches = objRegExp.Execute(stringa)
For Each Match in Matches
strTemp = strTemp & Match.Value
Next
Set objRegExp = Nothing
estrai= strTemp
End Function
MA quando faccio
Response.Write(estrai("http://www.youtube.com/watch?v=ddYCvAGd0Ig"))
non mi ritorna nulla[code]

Rispondi quotando