Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It (from a quick glance) is because you are trying to match:</p> <pre><code>Last Login: 11/14/2009 </code></pre> <p>With this regex:</p> <pre><code>Last([a-zA-Z0-9\s\.\-\',]*) </code></pre> <p>The regex doesn't contain the required characters of <code>:</code> and <code>/</code> which are included in the text string. Changing the required part of the regex to:</p> <pre><code>Last([a-zA-Z0-9\s\.\-\',:/]*) </code></pre> <p>Gives a match <br /></p> <p>Would it be better to simply use a <a href="http://simplehtmldom.sourceforge.net/" rel="nofollow noreferrer">DOM parser</a>, and then preform the regex on the result of the DOM lookup? It makes for nicer regex...</p> <p><strong>EDIT</strong></p> <p>The other issue is that your HTML is:</p> <p>...40%' align='right'class='SmallDimmedText'>...</p> <p>Where there is no space between align='right' and class='SmallDimmedText'</p> <p>However your regex for that section is:</p> <p>...40%\' align=\'right\' class=\'SmallDimmedText\'>...</p> <p>Where it is indicated there is a space.</p> <p><strong>Use a DOM Parser</strong> It will save you more headaches caused by subtle bugs than you can count.</p> <p>Just to give you an idea on how simple it is to parse using Simple HTML DOM.</p> <pre><code>$html = str_get_html(...); $elems = $html-&gt;find('.SmallDimmedText'); if ( count($elems-&gt;children()) != 1 ){ throw new Exception('Too many/few elements found'); } $text = $elems-&gt;children(0)-&gt;plaintext; //parsing here is only an example, but you have removed all //the html so that any regex used is really simple. $date = substr($text, strlen('Last Login: ')); $unixTime = strtotime($date); </code></pre>
 

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