擅长:python、mysql、java
<p>有一种方法可以做到:</p>
<pre><code>with open('somefile.txt') as f:
next(f) # Skips the first line, which doesn't have =
numbers = [line.split('=')[0] for line in f if len(line.strip())]
print(numbers)
</code></pre>
<p>如果要使用正则表达式:</p>
^{pr2}$