Files
parser/utils.go
Tristan Ancelet ff579dba44 Made change
2026-02-27 14:47:12 -06:00

29 lines
479 B
Go

package parser
import "regexp"
func doCheck(pattern string, arg string) (bool, error){
match, err := regexp.MatchString(pattern, arg)
if err != nil {
return false, err
}
if match {
return true, nil
} else {
return false, nil
}
}
func isFlag(arg string) (bool, error) {
return doCheck(flagRegex, arg)
}
func isInt(arg string) (bool, error) {
return doCheck(intRegex, arg)
}
func isFloat(arg string) (bool, error) {
return doCheck(floatRegex, arg)
}