title: Why did my regex not give the desired result
body: <p>I have a string from which I need to extract specific url that consists of an image extension and the following regex:</p>
  
  <pre><code>ITEMIMAGEURL\d+=(http://.*?)(,|$|\n)
  </code></pre>
  
  <p>and the string that I've to extract from is:</p>
  
  <pre><code>ITEMIMAGEURL0 = http://images.example.com/xyz/l/dasda/test-image-6af8af8afa9.jpg,
  ITEMIMAGEURL1 = http://images.example.com/xyz/l/dasda/test-image-,
  ITEMIMAGEURL2 = http://images.example.com/abc/as/test/test-image-abrd23lg9.jpg
  </code></pre>
  
  <p>My regex works fine but I want to extract only the url with <code>.jpg|.gif</code> or any other image extension so I've tried </p>
  
  <pre><code>ITEMIMAGEURL\d+=(http://.*?(?(?=.[a-zA-Z]{3,4})))(,|$|\n)
  </code></pre>
  
  <p>But it didn't work as expected </p>
  
  <p>My expected result is</p>
  
  <pre><code>http://images.example.com/xyz/l/dasda/test-image-6af8af8afa9.jpg
  http://images.example.com/abc/as/test/test-image-abrd23lg9.jpg
  </code></pre>