Skip to content

Commit

Permalink
improved regex title
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Sep 26, 2020
1 parent 3a5c564 commit 67c53a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/httpx/title.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67c53a9

Please sign in to comment.