I want to add an additional argument to my function using regular expressions and Python.
My function looks like this:
mail(arg1, arg2, arg3, arg4);
Can anyone help with regular expression to get this result:
mail(arg1, arg2, arg3, arg4, arg5);
I have an overall idea:
import os, fnmatch
for path, dirs, files in os.walk(os.path.abspath('directory')):
for filename in fnmatch.filter(files, '*.php'):
filepath = os.path.join(path, filename)
with open(filepath) as php:
i = php.read()
i = i.sub(re, re, line)
with open(filepath,"w") as f:
f.write(i)