How to find all 3 letter words and 3 digit numbers from a string in Python

1 Answer

0 votes
import re

s = "php 123 32 c++ abc python 1 3 788 9999 999 c"

lst = re.findall(r'\b\w{3}\b', s)

print(lst)




'''
run:

['php', '123', 'abc', '788', '999']

'''

 



answered Jul 18, 2019 by avibootz
...