Go语言中文网 为您找到相关结果 19

golang emoji表情处理

package util import ( "regexp" "strconv" "strings" ) //表情解码 func UnicodeEmojiDecode(s string) string { //emoji表情的数据表达式 re := regexp.MustCompile("\\[[\\\\u0-9a-zA-Z]+\\]") //提取emoji数据表达式 reg := regexp.MustCompile("\\[\\\\u|]") src := re.FindAllString(s, -1) for i := 0; i < len(src); i++ { e := reg.ReplaceAllString(src[i], "") p, err := strconv.Parse...阅读全文

博文 2017-02-09 17:35:13 赵世亮

GO 语言学习资料分享

链接:https://pan.baidu.com/s/1oauTymCxj-FzQp0331XY_w 提取码:l12h 链接:https://pan.baidu.com/s/1mRh6SqEXosK7BcBRaqn0nQ 提取码:yqib ![微信截图_20190416112716.png](https://static.studygolang.com/190416/e7f80c21f2cfab29a732e9d8dbd4a58f.png)![微信截图_20190416112726.png](https://static.studygolang.com/190416/036680a078f79723ec5e2c1d4fc33bce.png)![微信截图_201904161...阅读全文

golang语言实现读取csv文件内容,把相同的内容提取到另外一个文件

package main import ( "encoding/csv" "fmt" "io" "os" "path/filepath" "strconv" ) func CheckErr(err error) { if nil != err { panic(err) } } func GetFullPath(path string) string { absolutePath, _ := filepath.Abs(path) return absolutePath } func WriteFile(content []string) { f, err := os.OpenFile("sameName.csv", os.O_APPEND|os.O_CREATE, os.ModeAppend)...阅读全文

博文 2014-10-23 07:00:01 rufidmx

go提取字符串中的中文并生成字符串

package main import ( "fmt" // "time" ) //19968 40869 func main() { str := "1撒zxz是谁我我说-22_-laoYu#$@sd兰考县" r := []rune(str) //fmt.Println("rune=", r) strSlice := []string{} cnstr := "" for i := 0; i < len(r); i++ { if r[i] <= 40869 && r[i] >= 19968 { cnstr = cnstr + string(r[i]) strSlice = append(strSlice, cnstr) } //fmt.Println("r[", i, "]=", r[i],...阅读全文

博文 2016-11-12 06:00:04 u013870094

go 正则使用

正则可以高效对一段固定模式的内容,进行提取,例如从urlhttp://blog.jiguba.cn/2018/01... 正则模版 template=^http://blog.jiguba.cn/([\d]{4})/([\d]{2})/([\d]{2})/([w-]+).html$ 实现代码 package main import ( "fmt" "regexp" ) func main() { flysnowRegexp := regexp.MustCompile(`^http://blog.jiguba.cn/([\d]{4})/([\d]{2})/([\d]{2})/([w-]+).html$`) params := flysnowRegexp.FindStringSubmatch("...阅读全文

博文 2018-08-12 01:35:00 暮雨

IDE:GoLand && GoLang && go plugin Install action code

IDE:GoLand 下载 2019.1.2http://www.jetbrains.com/go/download/download-thanks.html?platform=windows Golang 下载 go plugin https://plugins.jetbrains.com/plugin/9568-go/update/62411 #链接:https://pan.baidu.com/s/1suBL_za7IzvF3ny-a0Gk1Q #提取码:8ksr #goland.exe.vmoptions #goland64.exe.vmoptions #两个文件的最后添加 #-javaagent:C:\Program Files\JetBrains\GoLand 2019.1.2\b...阅读全文

博文 2019-05-30 03:34:38 aicken_wang

文档数据提取 Golang 包XQuery

XQuery 是一个 Golang 包,允许从 HTML 或 XML 文档中使用 XPath 提取文档数据。 **安装** go get -u github.com/antchfx/xquery **HTML 查询** 这个包使用 Golang 官方包来解析 html 文件:html。 方法: Find(html.Node, string) []html.Node FindOne(*html.Node, string) *html.Node FindEach(*html.Node, string, func(int, *html.Node)) LoadURL(string) *html.Node **XML 查询** 方法: Find(_Node, stri...阅读全文

开源项目 2017-02-07 03:17:01 antchfx