Add tryParse and test cases, fix url parse regex