I have the ajax urls in the pattern shown below ;
http://example.com/v1/components/compId
http://example.com/v1/machine/machineId
http://example.com/v1/graph/startTime=value?endtime=value
http://example.com/v1/graph/startDate=value?enddate=value?startTime=value?endtime=value
I want to validate the above url-patterns in javascript.I have used some regex like
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; but its returning true for http://example.com/v1/machine/machineId and
http://example.com/v1 (this should return false).
please let me know is there any way to validate the above urls
Thanks in advance..