regular expression match with facebook username or id
<p>i found this regular expression in php</p>

<pre><code>preg_match('#https?\://(?:www\.)?facebook\.com/(\d+|[A-Za-z0-9\.]+)/?#',$str,$matches);
</code></pre>

<p>The pattern is versatile so it matches:</p>

<ol>
<li>http and https URL's.</li>
<li>URL's with or without the www prefix.</li>
<li>URL's with or without the trailing /.</li>
<li>Matches Facebook numerical ID's.</li>
<li>Matches Facebook's rules for usernames.</li>
</ol>

<p>i cant understand the expression cause i dont know too much about regex, the expression is correct?? it matches with the items??</p>

<p>i need this to use in javascript</p>

<p>wich is the equivalent in javascript??</p>
