Sorry if it seems like a newbie question but I was wondering if there was a way to count the amount of specific symbols like a dot or slash in a URL style format that a person has entered.
var regex = /https?:\/\/(www\.)?[A-Za-z=:.]{1,12}\.[A-Za-z]{1,6}\b([-A-Za-z0-9%_\+=?&//#]){1,250}/
var validx = regex.test(document.getElementById("webname").value);
That's the regex and how Im calling the text input. So from that I was wondering if there was a way of counting the amount of symbols a user has entered.
I thought I could just call the function that contained a checker but it does not work
function dotcheck()
{
var dots = detect.webname.value;
if (dots.indexOf(".") > 0){}
the function where I thought you could see/count the amount of dots there
if (dotcheck = false){
messages.innerHTML = 'Safe';
the if statement that I used to call the function.
Any help would be appreciated and if there is anything else you would need from me don't hesitate in asking.