title: How to extract a particular string value from response header in postman?
body: <p>I have below string and want to extract the value of code. I used split function but which runs fine in postman but when i execute same in newman it gives error.</p>
  
  <p>header1=<a href="https://debugger.com/ultradebugcode?code=EgxIZAAU3uHVt20pc9qqpv-xNcAWxitpB0vgMiulNLG2hkysukmjR04Fxxnuz9Yb&amp;state=ABC" rel="noreferrer">https://debugger.com/ultradebugcode?code=EgxIZAAU3uHVt20pc9qqpv-xNcAWxitpB0vgMiulNLG2hkysukmjR04Fxxnuz9Yb&amp;state=ABC</a></p>
  
  <p>I want to extract the value of code. which in this case is </p>
  
  <pre><code>EgxIZAAU3uHVt20pc9qqpv-xNcAWxitpB0vgMiulNLG2hkysukmjR04Fxxnuz9Yb
  </code></pre>
  
  <p>the code i am using is</p>
  
  <pre><code>    var str= pm.response.headers.get('header1');
      var str1= str.split('code=', 2)[1];
      var code= str1.split('&amp;', 2)[0]; // get the code
  </code></pre>
  
  <p>It worked fine in postman but why newman is giving error here?</p>