I'm working on a regular expression to validate a URL.
var url = "https://www,google.com";
var urlRegex = /(https|http)?:\/\/(?:\w[\-\w.]+)(?:\/[\-\w+&@#\/%=~_|!:,.;]*)?(?:\?[\-A-Z0-9+&@#\/%=~_|!:,.;]*)?/i;
var result = urlRegex.test(url);
Even though I am receiving "result" as true, it should actually be false because the "url" contains a comma. Any assistance would be greatly appreciated.