Bitdefender Interview Question

Given a string and the set of rules for a string to be a correct URL, write an algorithm to determine if a given string is an URL.