IBM interview question

Write a function to parse an incoming URL string and validate it