improved regex title

This commit is contained in:
Mzack9999 2020-09-26 21:34:05 +02:00
parent 3a5c56480a
commit 67c53a9f55

View File

@ -9,7 +9,7 @@ import (
// ExtractTitle from a response
func ExtractTitle(r *Response) (title string) {
var re = regexp.MustCompile(`(?im)<\s*title *>(.*?)<\s*/\s*title>`)
var re = regexp.MustCompile(`(?im)<\s*title.*>(.*?)<\s*/\s*title>`)
for _, match := range re.FindAllString(r.Raw, -1) {
title = html.UnescapeString(trimTitleTags(match))
break