3 Star 0 Fork 0

Gitee 极速下载 / misspell

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/client9/misspell
克隆/下载
url.go 523 Bytes
一键复制 编辑 原始数据 按行查看 历史
Nick Galbreath 提交于 2016-08-13 20:52 . simplify
package misspell
import (
"regexp"
)
// Regexp for URL https://mathiasbynens.be/demo/url-regex
//
// original @imme_emosol (54 chars) has trouble with dashes in hostname
// @(https?|ftp)://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$@iS
var reURL = regexp.MustCompile(`(?i)(https?|ftp)://(-\.)?([^\s/?\.#]+\.?)+(/[^\s]*)?`)
// StripURL attemps to replace URLs with blank spaces, e.g.
// "xxx http://foo.com/ yyy -> "xxx yyyy"
func StripURL(s string) string {
return reURL.ReplaceAllStringFunc(s, replaceWithBlanks)
}
1
https://gitee.com/mirrors/misspell.git
git@gitee.com:mirrors/misspell.git
mirrors
misspell
misspell
v0.3.4

搜索帮助