添加新关键词:年龄

This commit is contained in:
2024-07-04 17:22:56 +08:00
parent 13fa5a4dad
commit 463288ba3a
3 changed files with 15 additions and 3 deletions

View File

@@ -126,3 +126,12 @@ def handle_id(string):
return ""
# 防止过长存入数据库失败
return string[:50]
# 处理年龄类数据
def handle_age(string):
if not string:
return ""
string = string.split("")[0]
num = re.sub(r'\D', '', string)
return num[-3:]