Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyRegBackRef
#python 3.6.9 #PyRegBackRef #this code is created by Rezaul Hoque on February 20,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 phrase = 'Hurray Hurray, removing the word stray' pick=r'(\w+)\s+\1' changedPhrase = re.sub(pick, r'\1', phrase) print(changedPhrase) phrase2 = '"Hurray Hurray",removing the word stray' pick = r'([\'"])(.*?)\1' sample = re.search(pick, phrase2) print(sample.group()) phrase3 = 'Hurray Hurray, getting rid of the word stray' similar = r'\b\w*(\w)\1\w*\b' matches=re.finditer(similar,phrase3) for match in matches: print(match.group())
run
|
edit
|
history
|
help
0
Inheritance.py
PyStack
pythonic way (V2)
"Hello,world!"
Calc1
fibonacciseries
Omirp
HW L3
PyTeleBook
Square-Triangle Numbers