got it from here Regex to match URL, ends up matching URL plus closing brackets when URL is between brackets [duplicate]