I'm using the following regular expression to check if URLs are valid
var re = /^(http[s]?:\/\/(www\.)?|ftp:\/\/(www\.)?|www\.){1}([0-9A-Za-z-\.@:%_+~#=]+)+((\.[a-zA-Z]{2,3})+)(/(.)*)?(\?(.)*)?/;
var is_valid = re.test(input_url);
It works with small inputs, but starts to run endless with larger inputs. Consider the following 64-characters input
re.test("http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
Running this won't complete within minutes when running with an up-to-date Google Chrome.
Is there a problem with the regular expression?