上传文件至 /

This commit is contained in:
2026-04-02 16:07:32 +08:00
parent e470991d88
commit 304a2c3f51
4 changed files with 79 additions and 0 deletions

13
text1.py Normal file
View File

@@ -0,0 +1,13 @@
import re
text = '''
2024-03-15 天气:晴 温度15-25°C
2024-03-16 天气:多云 温度12-20°C
2024-03-17 天气:小雨 温度10-18°C
'''
pattern = r'(\d{4}-\d{2}-\d{2})\s*天气:([^ ]+)\s*温度:(\d+)-(\d+)°C'
matches = re.findall(pattern, text)
for match in matches:
date, weather, low, high = match
print(f'{date}: {weather}, {low}°C-{high}°C')