Javascript Regular Expression help

Posted by user270399 on Stack Overflow See other posts from Stack Overflow or by user270399
Published on 2010-04-19T08:41:00Z Indexed on 2010/04/19 8:43 UTC
Read the original article Hit count: 225

Filed under:
|

Hello! I have got the following regular expression working just fine in Rad Software Regular Expression designer.

param\s+name\s*=\s*"movie"\s+value=\s*"(?<target>.*?)"

And now i am wondering, how to get this to work in javascript. It keeps on complaininge about the "target" part. I am trying to validate and get the url from the youtube embed code.

<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/ueZP6ifzqMY&hl=sv_SE&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ueZP6ifzqMY&hl=sv_SE&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>

How the heck do i get this regex to work with my javascript? :)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex