Files
lm_code/test.py
Administrator 106612b6a7 fwefwf
2025-12-03 13:16:56 +08:00

12 lines
297 B
Python

import re
match = re.search(r"可用\s*([0-9,]+(?:\.[0-9]+)?)", "可用1,024.9964 USDT")
number = ""
if match:
# 提取匹配到的数值字符串
number_str = match.group(1).replace(',', '')
# 将提取的字符串转换为浮点数
number = float(number_str)
print(number)