Python - Strange Behavior in re.sub
- by Greg
Here's the code I'm running:
import re
FIND_TERM = r'C:\\Program Files\\Microsoft SQL Server\\90\\DTS\\Binn\\DTExec\.exe'
rfind_term = re.compile(FIND_TERM,re.I)
REPLACE_TERM = 'C:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\DTExec.exe'
test = r'something C:\Program Files\Microsoft SQL Server\90\DTS\Binn\DTExec.exe something'
print rfind_term.sub(REPLACE_TERM,test)
And the result I get is:
something C:\Program Files\Microsoft SQL Server@\DTS\Binn\DTExec.exe something
Why is there an @ sign?