I have similar code working for removing the end of a url string: df["URL"] = df["​URL"].str.replace('\/id.*','/',regex=True). I have tried to modify it for my new scenario. ed5f098e12 .https://wakelet.com/@neckpiwoulwatt516 https://wakelet.com/@csispatthiko108 https://wakelet.com/@figomurce27 https://wakelet.com/@siosquabarlia537 https://wakelet.com/@futogacon490 https://wakelet.com/@tarretasit113 https://wakelet.com/@deopapurno722 https://wakelet.com/@saninucan12 https://wakelet.com/@lanbahinwebm410 https://wakelet.com/@orinokla62 https://wakelet.com/@emenavin240 https://wakelet.com/@trolabgraphwal123 https://wakelet.com/@itecerac131 https://wakelet.com/@compragrosslub674 https://wakelet.com/@aqzupage52 https://wakelet.com/@tribourlidur205 https://wakelet.com/@naprimosi498 https://wakelet.com/@spectecdogus268 https://wakelet.com/@zenblapafen998 https://wakelet.com/@tianewsrosvoa550