【发布时间】:2018-10-05 02:32:08
【问题描述】:
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 = "No time. Not Today...Right Here!"
和
y = "The cab SCREECHES...his CARD"
如何使用正则表达式匹配来实现这一点?或者有没有更好的方法来解决这个问题?我正在使用 python。
【问题讨论】:
标签: python regex parsing split