From e21928928583b75e10c2d9d5539e9902a6ba1782 Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 6 Jun 2019 14:51:26 +0800 Subject: [PATCH] test --- obj.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/obj.go b/obj.go index 301369b..2dd94a9 100644 --- a/obj.go +++ b/obj.go @@ -523,7 +523,8 @@ func silentGetObjItemID(c string, n string) int64 { return i.ObjID64 } if ok, _ := regexp.MatchString(`u[0-9]+`, c); ok { - r := regexp.MustCompile(`^(?P⚡\+[0-9]+) (?P[a-zA-Z ]+?)( +(?P[0-9]+)⚔ +(?P[0-9]+)🛡){0,1}$`) + r := regexp.MustCompile(`^((?P⚡\+[0-9]+) ){0,1}(?P[a-zA-Z ]+?)( +(?P[0-9]+)⚔ +(?P[0-9]+)🛡){0,1}$`) + fmt.Printf("silentGetObjItemID(unique) : Modifier : %s\n", r.ReplaceAllString(n, "${Modifier}")) fmt.Printf("silentGetObjItemID(unique) : BaseName : %s\n", r.ReplaceAllString(n, "${BaseName}")) fmt.Printf("silentGetObjItemID(unique) : Atk : %s\n", r.ReplaceAllString(n, "${Atk}")) fmt.Printf("silentGetObjItemID(unique) : Def : %s\n", r.ReplaceAllString(n, "${Def}")) @@ -534,7 +535,8 @@ func silentGetObjItemID(c string, n string) int64 { } } if len(c) == 0 { - r := regexp.MustCompile(`^(?P⚡\+[0-9]+) (?P[a-zA-Z ]+?)( +(?P[0-9]+)⚔ +(?P[0-9]+)🛡){0,1}$`) + r := regexp.MustCompile(`^((?P⚡\+[0-9]+) ){0,1}(?P[a-zA-Z ]+?)( +(?P[0-9]+)⚔ +(?P[0-9]+)🛡){0,1}$`) + fmt.Printf("silentGetObjItemID(null) : Modifier : %s\n", r.ReplaceAllString(n, "${Modifier}")) fmt.Printf("silentGetObjItemID(null) : BaseName : %s\n", r.ReplaceAllString(n, "${BaseName}")) fmt.Printf("silentGetObjItemID(null) : Atk : %s\n", r.ReplaceAllString(n, "${Atk}")) fmt.Printf("silentGetObjItemID(null) : Def : %s\n", r.ReplaceAllString(n, "${Def}"))