Reputation: 12294
how will i escape the slashes // in javascript
var j = /^(ht|f)tp(s?)://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$;/
Upvotes: 2
Views: 286
Reputation: 630529
Use a \
for escaping, like this:
var j = /^(ht|f)tp(s?):\/\/([\w-]+\.)+[\w-]+(\/[\w-./?%&=]*)?$;/
Upvotes: 11