Ans:
import re str ='an apple a day keeps the doctor awaya'
result = re.findall(r'a[\w]*' , str) for word in result: print(word)
Oupput:
C:\Python_WorkSpace\TestProject\venv\Scripts\python.exe
C:/Python_WorkSpace/TestProject/regdemo2.py
an
apple
a
ay
awaya
No comments:
Post a Comment