I'm planning on using the code found below for BB code for my site:
http://forums.codecharge.com/posts.php?post_id=77123I have been able to modify it so far to my liking, however, I desire to add YouTube embedded videos.... and my regular expression knowledge is not very good. I have considered adding:
'/\[YT\](.*?)\[\/YT\]/is',
and
<object width="480" height="385"><param name="movie" value="
http://www.youtube.com/v/$1?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="
http://www.youtube.com/v/$1?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
... but this would require people to copy out only the ?v variable from the URL. I had also considered changing '/\[YT\](.*?) to '/\[YT\]http://www.youtube.com/watch?v\=(.*?) but, on occasion, youtube urls contain an & after the ?v, and this would need to be cut out (and I'm not sure how to do this).
Any ideas? I tried googling for existing, but php bb code pulls up to many phpbb code results. Also, reg-ex seems to have several poor tutorials on the web. : \