elvish/store/sql.go
2014-10-01 00:57:38 +02:00

12 lines
262 B
Go

package store
import "strings"
var globEscaper = strings.NewReplacer("\\", "\\\\", "?", "\\?", "*", "\\*")
// EscapeGlob escapes s to be suitable as an argument to SQLite's GLOB
// operator.
func EscapeGlob(s string) string {
return globEscaper.Replace(s)
}