GolangNote

Golang笔记

an error broken: unknown escape sequence: d

Permalink

当以下面的方式输入正则表达式时会有错误提示

an error broken: unknown escape sequence: d

Go: regexp
1
liRe, _ := regexp.Compile("<li>(\d+)/([\d,]+)Y(\d+)</li>")

抛出错误:

plaintext: error broken
1
an error broken: unknown escape sequence: d

使用反引号包住就好了

Go: Compile
1
liRe, _ := regexp.Compile(`<li>(\d+)/([\d,]+)Y(\d+)</li>`)

Write a Comment to "an error broken: unknown escape sequence: d"

Submit Comment Login
Based on Golang + fastHTTP + sdb | go1.16.5 Processed in 0ms