I need to alert user when the entered value
- does"t start with http:// or https:// or //
- if any of the above mentioned 3 words(http:// or https:// or //) were repeated in the entered value.
I tried the below regex in which the 1st case succeeds where 2nd case fails
var regexp = /^(http:(\/\/)|https:(\/\/)|(\\\\))/;
var enteredvalue="http://facebookhttp://"
if (!regexp.test(enteredvalue.value)) {
alert("not valid url or filepath);
}
Please help me regarding the same.