I am new to python and am starting to work with regular expressions and was wondering if it is possible to use the r prefix with a string variable? For example, I know if I have:
r'\\XY123/data\sheet\file1.xlsm'
This works. But is it possible to do something like this?
path_list =['\\XY123/data\sheet\file1.xlsm','\\XY123/data\sheet\file2.xlsm']
r + path_list[1]
I am going to be looping through a list of file path names and without the r prefix I am not catching everything I need. A code snippet:
path_list =['\\XY123/data\sheet\file1.xlsm','\\XY123/data\sheet\file2.xlsm']
for v in path_list:
vbaparser = VBA_Parser(v)
I would need the r prefix in VBA_Parser():
vbaparser = VBA_Parser(r+v)?? (I know this is wrong)
Any help is greatly appreciated!