I need to extract the word lack with one or 3 words following it from free text using RegEx,
import re
import string
Text = "lack of stair handrails, slippery surfaces, tripping hazards, lack of bathroom grab bars, lack floor"
new_data = re.search(r"(lack (\w+\W+){3})", Text)
print(new_data.group())
the result I got is only one sentence
lack of stair handrails,
but I need the result to be
lack of stair handrails
lack of bathroom grab bars
lack floor
Thanks in advance