dips255 0 Light Poster

this is related to link exchange
i have a form field where user can enter his website url or code with anchor tag to display hyperlink. i want to validate the input from user is done properly for hyperlink code(not allow any other html code). Can anyone suggest me how to do that.