I have this line of code in javascript
var re = (http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?
Usually I encapsulate the regex syntax with the / characters but since they are found within the regex it screws up the encapsulation. Is there another way how I can store it inside the variable?
The current slashes that seem like escape characters are part of the regex, since I am using this in c# aswell and works perfectly
&? That doesn't quite work with the character class. Also, no need to escape the + or . inside the character class.