Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
bom_identify
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2037534a
authored
Mar 15, 2021
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改匹配规则
parent
036e5d48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
utils/functions.py
utils/functions.py
View file @
2037534a
...
@@ -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
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment