Files
lm_code/test.py

12 lines
297 B
Python
Raw Normal View History

2025-12-03 13:16:56 +08:00
import re
2025-11-06 18:13:25 +08:00
2025-12-03 13:16:56 +08:00
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)
2025-11-06 18:13:25 +08:00
2025-12-03 13:16:56 +08:00
print(number)