I have a WYSIWYG textarea, and sometimes user's may enter a youtube url into the box. On the server side, there are html filters to prevent "harmful" code from being saved.
So instead, I'd like to just keep the server code as-is, and run a jQuery document ready event that searches a block of text for a youtube link, and converts it to the iframe embed code.
I'd imagine it would be regex based, but I'm absolutely horrid with regex's (at some point, I really need to sit down and study them).
Two types of youtube links:
http://www.youtube.com/watch?v=t-ZRX8984sc
or
http://youtu.be/t-ZRX8984sc