fork download
  1. // your code goes here
  2.  
  3. content = "<code class=\"http language-http\">HTTP/1.1 200 OK\nServer: Apache 2.0\nCache-control: private\nX-Powered-By: JSP/2.2\nContent-Type: text/html;charset=utf-8\nContent-Language: en-US\nContent-Length: 3347\n</code>";
  4. content = content.replace(/\n/g, "<unsualtag>");
  5. var codereg = /<code(.*?)>(.*?)<\/code>/g;
  6.  
  7.  
  8. var codesubstr = content.match(codereg);
  9.  
  10. console.log(codesubstr);
  11.  
Success #stdin #stdout 0.02s 17156KB
stdin
Standard input is empty
stdout
<code class="http language-http">HTTP/1.1 200 OK<unsualtag>Server: Apache 2.0<unsualtag>Cache-control: private<unsualtag>X-Powered-By: JSP/2.2<unsualtag>Content-Type: text/html;charset=utf-8<unsualtag>Content-Language: en-US<unsualtag>Content-Length: 3347<unsualtag></code>