Javascript regex in between selection -


guys how can extract content http://example.com?hashval=1375336351_846b1b2aaf64b3ebe493a848e1f07585 after decode url using regex? following url value before decode.

value="netstreambasepath=http%3a%2f%2fwww.example.com%2fhome%2fplayer.aspx%3flpk4%3d122943%26playchapter%3dfalse&id=ucplayernew_obj&file=http%3a%2f%2ffiles2.example.com%2fsecure%2fcontent%2f105371%2ff4v_h264%2fsample1.f4v%3fhashval%3d1375336351_846b1b2aaf64b3ebe493a848e1f07585&cname=up%20and%20running%20with%20sample%20sample2&vname=sample1%20sample1&cid=105371&vid=122943&type=video&autostart=true&start=0&volume=95&controlbar.position=none&display.icons=false" 

my current script decode url follow:

<script type="text/javascript"> function encode() {     var obj = document.getelementbyid('dencoder');     var unencoded = obj.value;     obj.value = encodeuricomponent(unencoded).replace(/'/g,"%27").replace(/"/g,"%22");   } function decode() {     var obj = document.getelementbyid('dencoder');     var encoded = obj.value;     obj.value = decodeuricomponent(encoded.replace(/\+/g,  " ")); } </script> 

thanks

if want extract file parameter:

> var value = "netstreambasepath=http%3a%2f%2fwww.example.com%2f ..." > decodeuricomponent(value.match('file=(.*?)($|&)')[1]) "http://files2.example.com/secure/content/105371/f4v_h264/sample1.f4v?hashval=1375336351_846b1b2aaf64b3ebe493a848e1f07585" 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -