import re
r = re.compile('\*(.+)\*')

def f(s):
     m = r.match(s)
     if m:
         return m.group(1)

l = ['asc', '*nbh*', 'jlsdjfdk', 'ikjh', '*jkjsdfjasd*', 'rewr']

n = [y for y in (f(x) for x in l) if y]

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to