mirror of https://github.com/fluffle/goirc
Regexes are consts.
This commit is contained in:
parent
ab3ac231da
commit
4a4c7f397c
|
@ -29,7 +29,7 @@ type youTubeVideo struct {
|
||||||
} `json:entry`
|
} `json:entry`
|
||||||
}
|
}
|
||||||
|
|
||||||
var UrlRegex string = `(\s|^)(http://|https://)(.*?)(\s|$)`
|
const UrlRegex string = `(\s|^)(http://|https://)(.*?)(\s|$)`
|
||||||
|
|
||||||
func UrlFunc(conn *Conn, line *Line) {
|
func UrlFunc(conn *Conn, line *Line) {
|
||||||
text := line.Message()
|
text := line.Message()
|
||||||
|
@ -52,7 +52,7 @@ func UrlFunc(conn *Conn, line *Line) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var YouTubeRegex string = `(\s|^)(http://|https://)?(www.)?(youtube.com/watch\?v=|youtu.be/)(.*?)(\s|$|\&|#)`
|
const YouTubeRegex string = `(\s|^)(http://|https://)?(www.)?(youtube.com/watch\?v=|youtu.be/)(.*?)(\s|$|\&|#)`
|
||||||
|
|
||||||
func YouTubeFunc(conn *Conn, line *Line) {
|
func YouTubeFunc(conn *Conn, line *Line) {
|
||||||
text := line.Message()
|
text := line.Message()
|
||||||
|
|
Loading…
Reference in New Issue