我想完全按照标题说的去做。因此,我有下面显示的字符串,我希望能够找到所有的双线换行符(可能在中间有空格,如下所示,可能没有):
input = """4. A drawer locli:ing device for locl@.ing ,t
15 tier of draivers, one of which is lock controllecl, comprising
twc, drawer retainina m--mbe , rs loica@ted at the front of th-.
drawer@' oiie acljacept each side of the tier of dra,-wers ar,d
arranged to
overlap the front of the,"""
output = re.finditer('\n[\S+]\n', nameString)?????????????????????
output[0] = "4. A drawer locli:ing device for locl@.ing ,t
15 tier of draivers, one of which is lock controllecl, comprising"
output[1] = "twc, drawer retainina m--mbe , rs loica@ted at the front of th-.
drawer@' oiie acljacept each side of the tier of dra,-wers ar,d
arranged to
overlap the front of the,"
看看这个:
现在我们导入regex:
^{pr2}$然后我们把它分开:
现在显示结果:
相关问题 更多 >
编程相关推荐