Morning,
I'm attempting to perform a preg_match against a regular expression to identify whether it's a YouTube video or not. I've got, I'll admit, the regular expression from elsewhere...
\s(https?:\/\/www.youtube(?:-nocookie)?.com\/(?:v|embed)\/([a-zA-Z0-9-]+)).
This appears to work fine. However, I'm getting the following error when I attempt the preg_match...
WARNING: [filename].php:[line] - preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash
Looking at other similar regular expressions I think the format isn't quite right as they appear to use hashes around the expression. However, I'm at a lose at what to do with it to get it to work the same (I've had a tinker - the error went but nothing matched either).
Can anybody help me out with this?
David.