github.com/wfusion/gofusion@v1.1.14/common/constant/regexp.go (about) 1 package constant 2 3 import "regexp" 4 5 var ( 6 NumberReg = regexp.MustCompile(`\d+`) 7 NonNumberReg = regexp.MustCompile(`\D+`) 8 9 LetterReg = regexp.MustCompile(`[a-zA-Z]+`) 10 NonLetterReg = regexp.MustCompile(`[^a-zA-Z]+`) 11 12 NumberLetterReg = regexp.MustCompile(`[a-zA-Z0-9]+`) 13 NonNumberLetterReg = regexp.MustCompile(`[^a-zA-Z0-9]+`) 14 15 // FlavorNameReg 16 //nolint: revive // reg expression issue 17 FlavorNameReg = regexp.MustCompile(`(?P<prefix>([scm]|pi|pak|pck|lite|ir)\d+|[lkhf][scm]\d+|p2v(s)?|g\d+(s)?|p8a)\.(?P<middle>small|medium|large|(\d+)*xlarge)\.(?P<suffix>\d+(\.\d)?)`) 18 19 // FullFlavorNameReg 20 //nolint: revive // reg expression issue 21 FullFlavorNameReg = regexp.MustCompile(`^(?P<prefix>([scm]|pi|pak|pck|lite|ir)\d+|[lkhf][scm]\d+|p2v(s)?|g\d+(s)?|p8a)\.(?P<middle>small|medium|large|(\d+)*xlarge)\.(?P<suffix>\d+(\.\d)?)$`) 22 )