I need a python regular expression through which I can replace certain values in the path
"path":"C:\Users\admin\Downloads\npp.8.0.Installer.exe"
"path": "C:\Program Files (x86)\Google\Common\Google Updater\Extensions\GoogleUpdaterService.exe"
to
"path":"<drive>:\Users\<uname>\Downloads\npp.8.0.Installer.exe"
"path": "<drive>:\Program Files (x86)\Google\Common\Google Updater\Extensions\GoogleUpdaterService.exe"
The replace values are "<'drive'>" and "<'username'>"(if any username exists in the path).
I am trying with
re.sub(pattern, repl, string, count=0, flags=0).
How can I most easily build a pattern which can replace the above valve ?