From 58737c5a070818c8a61c5dbf3a50c11bb9878ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 27 Apr 2020 18:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=89=B2=E5=95=86=E5=93=81=E5=90=8D?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=88=99=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=90=8E=E7=BC=80=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxutils/jxutils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index 149438c4c..c28ce415e 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -71,7 +71,7 @@ func init() { // Go regex does not support lookarounds. // https://stackoverflow.com/questions/38933898/error-parsing-regexp-invalid-or-unsupported-perl-syntax - skuNamePat = regexp.MustCompile(`([\((\[【][^\((\[【\))\]】]*[\))\]】])?(.*?)([((].*[))])?\s*约?([1-9][\d\.]*)(g|G|kg|kG|Kg|KG|l|L|ml|mL|Ml|ML|克)\s*([((].*[))])?\s*(?:\/|/|)\s*([^\s()()]{0,2})\s*([((].*[))])?$`) + skuNamePat = regexp.MustCompile(`([\((\[【][^\((\[【\))\]】]*[\))\]】])?(.*?)([((].*[))])?\s*约?([1-9][\d\.]*)(g|G|kg|kG|Kg|KG|l|L|ml|mL|Ml|ML|克)\s*([((].*[))])?\s*(?:\/|/|)\s*([^\s()()]{0,2})(\s.*)?$\s*([((].*[))])?$`) emailPat = regexp.MustCompile(`[A-Za-z0-9_\-.]+@(?:[A-Za-z0-9_\-]+\.)+[A-Za-z]+`) } @@ -419,6 +419,8 @@ func SplitSkuName(skuName string) (prefix, name, comment, specUnit, unit string, comment = searchResult[6] } else if searchResult[8] != "" { comment = searchResult[8] + } else if searchResult[9] != "" { + comment = searchResult[9] } comment = TrimDecorationChar(comment) name = TrimDecorationChar(searchResult[2])