Updated regex to handle \n and > at the start of the url

PR as per @bryanwoods; Updated regex to handle \n and > at the start of the url