mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-10-02 20:57:42 +00:00
9 lines
162 B
Go
9 lines
162 B
Go
package stringutil
|
|
|
|
import "regexp"
|
|
|
|
func SanitizeID(id string) string {
|
|
reg := regexp.MustCompile(`[^a-zA-Z0-9_\-\.]+`)
|
|
return reg.ReplaceAllString(id, "_")
|
|
}
|