【发布时间】:2021-10-29 06:49:15
【问题描述】:
我的字符串如下所示:
string=""
( 2021-07-10 01:24:55 PM GMT )TEST
---
Badminton is a racquet sport played using racquets to hit a shuttlecock across
a net. Although it may be played with larger teams, the most common forms of
the game are "singles" (with one player per side) and "doubles" (with two
players per side).
( 2021-07-10 01:27:55 PM GMT )PATRICKWARR
---
Good morning, I am doing well. And you?
---
---
* * *""
我正在尝试将字符串拆分为:
text=['羽毛球是一种球拍运动,使用球拍击打 毽子过网。虽然它可能与更大的团队一起玩, 最常见的游戏形式是“单人”(每人一个玩家 边)和“双打”(每边有两名球员)。','早上好,我是 做得好。你呢?']
我尝试过的:
text=re.findall(r'\( \d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2} PM GMT \)\w+ [\S\n]--- .*',string)
我不知道如何提取多行。
【问题讨论】:
标签: python-3.x regex string