How to convert a C# regex to javascript?
<p><strong>Overview:</strong></p>

<p>I'm using this regex in server side C# validation code. Now I need to implement the same regex in javascript on the client side. When I define the regex in js the compiler throws syntax errors on the pattern stating there are invalid characters.</p>

<pre><code>var urlValidationRegex = /(https?|ftp)://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$/;
</code></pre>

<p><strong>Resolution Steps:</strong></p>

<p>I tried adding a <code>/</code> to the start and end of the regex pattern, but that throws further syntax errors.</p>

<p><strong>Question:</strong></p>

<p>How can i convert this regex to a javascript equivalent?</p>