title: Regex to extract data between two pipe symbols
body: <p>I am looking to extract "2" from the query parameter using Regex - </p>
  
  <pre><code>http://www.example.com?param=1|2|3|4|test&amp;param1=5|6
  </code></pre>
  
  <p>Regex used - </p>
  
  <pre><code>.*param=.*\|(\w+)\|.*
  </code></pre>
  
  <p>The output I get is "4".</p>
  
  <p>I have even tried this to no avail - </p>
  
  <pre><code>.*param=.*\|(.*?)\|.*
  </code></pre>
  
  <p>Any help is much appreciated.</p>
  
  <p>Thanks</p>