Made change

This commit is contained in:
Tristan Ancelet
2026-02-27 14:47:12 -06:00
commit ff579dba44
11 changed files with 794 additions and 0 deletions

28
utils.go Normal file
View File

@@ -0,0 +1,28 @@
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)
}