Commit 2037534a by 陈森彬

修改匹配规则

parent 036e5d48
Showing with 3 additions and 3 deletions
...@@ -65,12 +65,12 @@ def cut_params(kw): ...@@ -65,12 +65,12 @@ def cut_params(kw):
def check_param(kw): def check_param(kw):
""" """
提取参数,从一个字符串里面提取的参数大于2的时候才返回 提取参数,正则匹配得出才返回
:param kw: :param kw:
:return: :return:
""" """
check_res = unit_pattern.findall(kw) check_res = unit_pattern.findall(kw)
if len(check_res) < 2: if len(check_res) < 1:
check_res = [kw] check_res = [kw]
else: else:
new_list = [] new_list = []
...@@ -280,7 +280,7 @@ def check_param_k(kw): ...@@ -280,7 +280,7 @@ def check_param_k(kw):
else: else:
check_res = kw.upper().split("K") check_res = kw.upper().split("K")
if check_res[1] and check_res[1] not in split_char: if check_res[1] and check_res[1] not in split_char: # 判断K后面不能带其他参数单位,只能带分隔符
return False return False
if check_res[0].isdigit() or "." in check_res[0]: if check_res[0].isdigit() or "." in check_res[0]:
if "." in check_res[0]: if "." in check_res[0]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment