Cutting text with javascript - Javascript String

Javascript examples for String:replace

Description

Cutting text with javascript

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from  ww  w. j  a  va  2s  .c o  m*/
var str = '[19:00:14] test test test> <url=fitting:17740:2048;1:2;1:7;8:2;2:2;1:1;1:10;4:1;1:2;1:1;1:19;2:3;5:2;13:23;2:2;200::>test</url>';
str = str.replace(/^.+?(<url=[^>]+>).+$/, '$1');
console.log(str);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials