views:

47

answers:

1

so the problem is, i have a contenteditable div, with a keyup function binded. everytime somebody puts a youtube url in it, it has to be replaced by an embedded movie.

i came up with a regex like this :

content.match(/http:\/\/\w{0,3}.?youtube+\.\w{2,3}\/watch\?v=.*?(?=\s)/g);

firefox wil do the replace after a whitespace, but in ie it won't work.

any suggestions? thnx in advance!

A: 

I'm not the best at regex, but I did post an answer a while back about replacing youtube url text with the embeded player. Maybe it'll help?

fudgey