Minimize Number of Lists
New regex

If you change your regular expression to the following you won't need to even do str.strip()

valuepattern = re.compile("'(\d+)'")


List Comprehension

Alternatively if you don't want to do that, you could do the following. Currently you have:

for item in l:
    li.append(item.strip("'"))


This can be replaced with a list comprehension:

l = [x.strip("'") for x in l]


Final Note

As you compile your regular expression, you can replace

re.findall(valuepattern, s)


with

valuepattern.findall(s)