Regexes are consts.

This commit is contained in:
Chris Rhodes 2013-02-18 17:33:55 -08:00
parent ab3ac231da
commit 4a4c7f397c
1 changed files with 2 additions and 2 deletions

View File

@ -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()