阶段性提交

This commit is contained in:
刘祥超
2020-09-13 19:27:47 +08:00
commit dd504b39c8
120 changed files with 19900 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package shared
import "regexp"
// 常用的正则表达式
var (
RegexpDigitNumber = regexp.MustCompile(`^\d+$`) // 正整数
RegexpFloatNumber = regexp.MustCompile(`^\d+(\.\d+)?$`) // 正浮点数不支持e
RegexpAllDigitNumber = regexp.MustCompile(`^[+-]?\d+$`) // 整数,支持正负数
RegexpAllFloatNumber = regexp.MustCompile(`^[+-]?\d+(\.\d+)?$`) // 浮点数支持正负数不支持e
RegexpExternalURL = regexp.MustCompile("(?i)^(http|https|ftp)://") // URL
RegexpNamedVariable = regexp.MustCompile("\\${[\\w.-]+}") // 命名变量
)