extract numbers from list of strings python using regex

Solutions on MaxInterview for extract numbers from list of strings python using regex by the best coders in the world

showing results for - "extract numbers from list of strings python using regex"
Josefa
04 Jul 2017
1ip=['a',1,2,3]
2m=[]
3n=[]
4for x in range(0,len(ip):
5    if str(ip[x]).isdigit():
6        m.append(ip[x])
7    else:n.append(ip[x])
8print(m,n)
Ilian
26 Aug 2019
1new_list = [int(item) for sublist in a for item in sublist if item.isdigit()]
2