GolangNote

Golang笔记

an error broken: unknown escape sequence: d

Permalink

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

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>`)

本文网址: https://golangnote.com/topic/102.html 转摘请注明来源

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

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