擅长:python、mysql、java
<p>Bernz的解决方案奏效了,我使用了如下所示的代码。数据摔跤手的答案也会起作用。你知道吗</p>
<pre><code>for line in stringg.split('\n'):
if re.findall('(\w+) has entered the above notes on (\d{1,2}/\d{1,2}/\d{4}) (\d{1,2}:\d{1,2})', line):
print line.split()[0] + " " + line.split()[-2] + line.split()[-1]
else:
print line
</code></pre>