GO 正则匹配邮箱地址

GO 正则匹配邮箱地址

package mainimport ("fmt" "regexp")const text = `My email is 8899666@qq.comemail1 is abc@def.orgemail2 is kkk@qq.comemail3 is ddd@abc.com.cn`func main() {//确定要寻找的目标及返回需要的字符段 ...

Goland 2020-10-30 PM 2621次 0条
Go语言:发送HTTP请求(GET & POST)

Go语言:发送HTTP请求(GET & POST)

package main import ( "bytes" "encoding/json" "io" "io/ioutil" "net/http" "time" ) // 发送GET请求 // url: 请...

Goland 2020-10-30 PM 3039次 0条
go语言http设置及超时请求

go语言http设置及超时请求

package main import ( "log" "net/http" //http 请求用 "io" // io.Copy获取http请求状态用;HttpPost "os" // os.Stdout 取io.Copy 返回数据中的status;Http...

Goland 2020-10-30 PM 2148次 0条
go 创建文件读取文件写入文件删除文件

go 创建文件读取文件写入文件删除文件

package main import ( "bufio" "fmt" "io" "os" ) func readtxt(filename string){ file,err:=os.Open(filename) if err!=nil { ...

Goland 2020-10-29 PM 1785次 0条
go Base64 编码解码

go Base64 编码解码

package main import b64 "encoding/base64" import "fmt" func main() { data := "abc123!?$*&()'-=@~" sEnc := b64.StdEncoding.EncodeToString([]byte(data)) fm...

Goland 2020-10-26 PM 1883次 0条
go 伪造User-Agent 抓取网页代码

go 伪造User-Agent 抓取网页代码

package main import ( "fmt" "io/ioutil" "net/http" "time" ) func main() { client := &http.Client{ Timeout: 2 * time.Second,...

Goland 2020-10-26 PM 1912次 0条
go 获取自身路径

go 获取自身路径

package main import ( "fmt" "syscall" "unicode/utf16" "unsafe" ) var( kernel=syscall.MustLoadDLL("kernel32.dll") getModu...

Goland 2020-10-26 PM 1651次 0条
goland 提交表单

goland 提交表单

package main import ( "net/http" "net/url" "fmt" "io/ioutil" ) func main() { //?mod=forumdisplay&fid=42 params:=url.Values{ ...

Goland 2020-10-26 PM 1863次 0条
go字符串的遍历输出

go字符串的遍历输出

package main import ( "fmt" ) func main() { str := "Hello,世界" //方法一:格式化打印 for _, ch1 := range str { fmt.Printf("%q",ch1) //单引号围绕的字符字面值,由go语法安...

Goland 2020-10-26 PM 2004次 0条
go 正则贪婪匹配

go 正则贪婪匹配

package main import ( "fmt" "regexp" ) func main(){ r,_:=regexp.Compile("aaa(.*?)bbb") matches:=r.FindAllString("42342342aaa111111111111bbbasd...

Goland 2020-10-26 PM 2029次 0条
go UTF-8 to gbk 编码转换

go UTF-8 to gbk 编码转换

examplepackage main import "fmt" import "github.com/axgle/mahonia" func main(){ enc:=mahonia.NewEncoder("gbk") //converts a string from UTF-8 to gbk encoding. f...

Goland 2020-10-26 PM 2858次 0条