I'm trying to rename files using regex in python, with only one default works:
def new_string(pattern):
text = pattern.group().lower()
renturn "{}_{}".format(text[0], text[1])
regex = re.compile(r"[a-z][A-Z]")
for x in files:
print(regex.sub(new_string, x))
But I want to replace other patterns as well:
r"[a-zA-Z][0-9]"
How do you find the two patterns instead of one?