Convert list of strings into integers with Regular Expression
<p>I am currently trying to understand Regular Expressions. I have a hard time understanding how I should solve this:</p>

<pre><code>import re

fhand = open("assign11.txt")

lst = list()
for line in fhand:
    line = line.rstrip()
    x = re.findall("([\d]+)", line)
    if not len(x) &gt; 0: continue
    numlist = int(x[:])
    d = list.append(numlist)

print(lst)
</code></pre>

<p>I want to the program to match every substring that is an integer(0-9) with the help of re.findall(), and then convert the substrings it finds into integers, append them to a list, and sum them up. </p>

<p>Put I can´t figure out a way to convert all of the substrings in each line to a integer, it only works if i write int(x[0]), but not if I write (x[:]). How do I change every substring( When there are more than one number in the substring) into a integer?</p>