Q:

php- parsing youtube video id

Possible Duplicate:
parse youtube video id using preg_match 

I'd like to extract the youtube video id from an input string via regular expressions. The input is always as follows: [youtube=-J_JLXuioEI] and I need the id, which is -J_JLXuioEI in this case.
Now I use the following regular expression: 
preg_match_all('/youtube=([a-zA-Z0-9\-_]+)/', $string, $m );

I fear that Google uses other characters like ! in their ids and so I would like to ask if you have a general id how to parse these ids.
Thanks much in advance,
enne

A:

Just get everything after = and before ]. Like
/\[youtube=(.+)\]/

