Skip to content

Commit

Permalink
修复预设正则
Browse files Browse the repository at this point in the history
  • Loading branch information
M09Ic committed Sep 15, 2022
1 parent 54d4d12 commit 8f5d138
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v2/pkg/load_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ var (
)

var PresetExtracts = map[string]*regexp.Regexp{
"url": regexp.MustCompile("^(http(s)?:\\/\\/)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:[0-9]{1,5})?[-a-zA-Z0-9()@:%_\\\\\\+\\.~#?&//=]*$"),
"url": regexp.MustCompile(`(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?`),
"ip": regexp.MustCompile("((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}"),
"mail": regexp.MustCompile("^([A-Za-z0-9_\\-\\.\u4e00-\u9fa5])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,8})$"),
"idcard": regexp.MustCompile("^(\\d{15}$)|(^\\d{17}([0-9]|[xX]))$"),
"phone": regexp.MustCompile("^(\\+?0?86\\-?)?1[3-9]\\d{9}$"),
"mail": regexp.MustCompile("([A-Za-z0-9_\\-\\.\u4e00-\u9fa5])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,8})"),
"idcard": regexp.MustCompile("(\\d{15}$)|(^\\d{17}([0-9]|[xX]))"),
"phone": regexp.MustCompile("(\\+?0?86\\-?)?1[3-9]\\d{9}"),
"header": regexp.MustCompile("(?U)^HTTP(?:.|\n)*[\r\n]{4}"),
"body": regexp.MustCompile("[\\r\\n]{4}[\\w\\W]*"),
"cookie": regexp.MustCompile("(?i)Set-Cookie.*"),
Expand Down

0 comments on commit 8f5d138

Please sign in to comment.