Dutch_guy
asked on
ASP, vbscript - regex replace
I want to replace some text in the following code that users can insert in a CMS system:
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/W8_Kfjo3VjU&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><para m name="allowscriptaccess" value="always"></param><em bed src="http://www.youtube.com/v/W8_Kfjo3VjU&hl=nl_NL&fs=1&" type="application/x-shockw ave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></obj ect>
As you can see this is from Youtube to embed a video.
I want to replace these strings in the code:
width="480"
height="385"
These strings can be variable. For instance someone can just insert: width="2480"
I want to avoid people from doing that.
Those 2 stings need to be replaced by:
width="320"
height="200"
Can anyone give some code to do that ?
Also any idea's how to do a basic validation that the code people insert is indeed to embed a Youtube video ?
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/W8_Kfjo3VjU&hl=nl_NL&fs=1&"></param><param name="allowFullScreen" value="true"></param><para
As you can see this is from Youtube to embed a video.
I want to replace these strings in the code:
width="480"
height="385"
These strings can be variable. For instance someone can just insert: width="2480"
I want to avoid people from doing that.
Those 2 stings need to be replaced by:
width="320"
height="200"
Can anyone give some code to do that ?
Also any idea's how to do a basic validation that the code people insert is indeed to embed a Youtube video ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER