I am using following code :
re.sub(inputpattern,outputpattern, currentline)
in the above code , i am reading the value of outputpattern from csv , whose value is :
\\1-\\2-\\3-\\4
I am reading it like below :
outputpattern = row['PREFIX_1_WRT_FMT']
I have also tried :
outputpattern = "'"+ row['PREFIX_1_WRT_FMT'] +"'"
The problem is that it is not treating it as proper format , but if I hard code it like below it works fine :
re.sub(inputpattern,'\\1-\\2-\\3-\\4', currentline)
outputpattern
has double backslashes in it. What do you see when you open the csv file in a text editor?