Contact: aviboots(AT)netvision.net.il
39,941 questions
51,879 answers
573 users
import re s = 'a213python 34 java98 c++ 88397 php 3.14 swift 6-89x' lst = re.findall('[0-9]+', s) print(lst) ''' run: ['213', '34', '98', '88397', '3', '14', '6', '89'] '''
s = 'a213python 34 java98 c++ 88397 php 3.14 swift 6-89x' lst = [int(temp)for temp in s.split() if temp.isdigit()] print(lst) ''' run: [34, 88397] '''