Skip to navigation
Find and replace with the help of regular expression in Python
12.09.21
#!/usr/bin/env python import re def set_picture(url): print(url) m = re.search(r"/\d+/\d+/", url) replace = m.group(0) url2 = url.replace(replace, '/1000/1000/',1 ) print(url2) return url
https://docs.python.org/3/library/re.html
Reply
Anonymous
Information Epoch 1732535471
Don't do anything the computer can do for you.
Home
Notebook
Contact us