Overview:
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.
var urlValidationRegex = /(https?|ftp)://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$/;
Resolution Steps:
I tried adding a /
to the start and end of the regex pattern, but that throws further syntax errors.
Question:
How can i convert this regex to a javascript equivalent?