You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gophi/gemini/regex.go

17 lines
336 B
Go

package gemini
import (
"gophi/core"
"regexp"
)
var (
// gemRegex is the precompiled gemini file name regex check
gemRegex = regexp.MustCompile(`^(|.+/|.+\.)gmi$`)
)
// isGem checks against gemini regex as to whether a file path is a gemini file
func isGem(path *core.Path) bool {
return gemRegex.MatchString(path.Relative())
}