extract the domain name form a url using regex code example Example: regex to get website name from url /^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img