Tag: go

How to unescape escaped regex?

问题内容: I’m looking for the reverse of regexp.QuoteMeta. Is it there a such function? I’ve tried to manually unescape it using strings.Replace("\", "", -1) but this is prone to error/unreliable as it doesn’t work in all the cases(i.e. on excessive escaping or unicode). I also tried to add some quotes and use strconv.Unquote (e.g. strconv.Unquote(“+