programming-examples/python/Regular_Expression/Find all three, four, five characters long words in a string.py

3 lines
111 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
import re
text = 'The quick brown fox jumps over the lazy dog.'
print(re.findall(r"\b\w{3,5}\b", text))