【发布时间】:2018-04-24 05:01:49
【问题描述】:
No time. Not today.
(slides in last bullets)
Ten, eleven, twelve... or bust.
(chambers a shell into each
gun, looks up)
Right here!
The cab SCREECHES to a stop on the shoulder of the highest
FREEWAY in a massive INTERCHANGE of freeways. Dopinder halts
the meter and hands Deadpool his CARD.
我的目标是解析上述文本,使对话与描述分开。我的文件中有多个这样的实例。输出应该是两个单独的字符串 x 和 y,其中: x = “没时间。不是今天……就在这里!”和 y = “出租车尖叫……他的卡片”。
如何使用正则表达式匹配来实现这一点?或者有没有更好的方法来解决这个问题?我正在使用 python。
【问题讨论】:
-
试试beautifulsoup?
标签: python html regex parsing split