Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>&lt;?php $referenceStr = "&lt;td width=120 valign=\"top\"&gt; &lt;div style=\"height:135px; border:1px solid #BBBBBB; background:#BBBBBB; margin-left:2px; text-align:center; \"&gt; &lt;a href=\"/now/episodes.php?name=path&amp;id=4000&amp;sid=12345&amp;page=0\"&gt;&lt;img border=\"0\" src=\"http://www.somesite.com/1234.jpg\" width=\"150\" height=\"83\"&gt;&lt;/a&gt;&lt;br&gt; &lt;font face=\"Tahoma\" size=\"2\"&gt;&lt;b&gt;Star Album&lt;/b&gt;&lt;br/&gt; episode 4 &lt;/font&gt; &lt;/div&gt; &lt;/td&gt;"; $key = 'sid'; preg_match('/(?:&amp;|(\?))' . $key . '=[^&amp;]*(?(1)&amp;|)?/i', $referenceStr,$matches); foreach($matches as $k =&gt; $v) $matches[$k] = str_replace(array('&amp;sid=','sid='),'',$v); print_r($matches); ?&gt; </code></pre> <p>Here is a PHP solution, just use the pattern, it will work for JS too.</p> <p>For JS : </p> <pre><code>var code = '&lt;td width=120 valign="top"&gt; &lt;div style="height:135px; border:1px solid #BBBBBB; background:#BBBBBB; margin-left:2px; text-align:center; "&gt; &lt;a href="/now/episodes.php?name=path&amp;id=4000&amp;sid=12345&amp;page=0"&gt;&lt;img border="0" src="http://www.somesite.com/1234.jpg" width="150" height="83"&gt;&lt;/a&gt;&lt;br&gt; &lt;font face="Tahoma" size="2"&gt;&lt;b&gt;Star Album&lt;/b&gt;&lt;br/&gt; episode 4 &lt;/font&gt; &lt;/div&gt; &lt;/td&gt;'; matchingelements = code.match(/sid\=*(\d*)/ig); for(i=0;i&lt;code.length;i++){ document.write(matchingelements[i].replace('&amp;sid=','').replace('sid=','')); } </code></pre> <p>This outputs 12345</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload