[英]What is the difference between a regular expression quoted by ` and "?
為什么C:\\\\\\\\
(由`引用) regexp與"C:\\\\"
和"C:\\\\\\\\"
不匹配?
r, err := regexp.Compile(`C:\\\\`) // Not match
r, err := regexp.Compile("C:\\\\") // Matches
if r.MatchString("Working on drive C:\\") == true {
fmt.Printf("Matches.")
} else {
fmt.Printf("No match.")
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.