title: extract integer from html according to multiple parameters with sed
body: <p>First of all, let me say this:<br>
  I know regx'ing html is considered a bad approach, but if chuck norris can, why can't I? ;)<br>
  I want to parse this html page: <a href="http://pastebin.com/unAifctF" rel="nofollow">http://pastebin.com/unAifctF</a><br>
  based on three parameters. i tried: (thank you pixellany)</p>
  
  <pre><code>sed -n  '/hebrew/{/DESPiTE/s/downloadsubtitle.php?id=/XXX/1};s/.*XXX\([0-9]*\).*/\1/p'  
  </code></pre>
  
  <p>which returns 228344 instead of 228338<br>
  and i tried: (thank you doubleDown) </p>
  
  <pre><code>sed -nr 's/.*downloadsubtitle.php\?id\=([0-9]+).*hebrew.*DESPiTE.*/\1/p'  
  </code></pre>
  
  <p>which returns 228343 instead of 228338
  the expected result is 228338 because it's the first number preceded by "downloadsubtitle.php\?id\=" and followed by "hebrew" and "DESPiTE"<br>
  what am I missing?</p>