Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyRegSearch
#python 3.6.9 #PyRegSearch #this code is created by Rezaul Hoque on February 28,2022; #contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; import re a = '''Today is February 28. Some years February has 29 days. December, January, July and August are the consecutive months that have 31 days.''' pat = '\d+\s(\w+)ys' fit = re.search(pat,a) if fit is not None: print(fit.group()) else: print('No match found') pat2= r'\b((\w+)ary)\b' m = re.search(pat2, a) if m is not None: print(m.groups()) pat3= r'\b(\w+)ber\b' m2 = re.search(pat3, a, re.MULTILINE) print(m2)
run
|
edit
|
history
|
help
0
Right_Align_Text
Lesson7 Final
HW Descending order
5
jhjhh
PyQP
isPythagorasTriplet.py
python_study_note_while loop
testpgm
lesson 6 finallll