programming-examples/python/Regular_Expression/Find all words which are at least 4 characters long in a string.py

3 lines
110 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{4,}\b", text))