I am trying to match a specific word in between backslashes in the windows file path of a file. The value to match is "Psb+" for this case
X:\Guli\Proc(Loops)\Read\Psb+\İngil\Fate\5.0X[Lxss.] [Psb+] Instructions.txt
Due to software limitations I cannot use import os but I can use Pythonnet.
My regex is like this
pFilePath = "X:\Guli\Proc\(Loops)\Read\Psb+\İngil\Fate\5.0X\[Lxss.] [Psb+] Instructions.txt"
searchtext = "Psb+"
pm = re.search(r'(?i)(?<="\\")' + searchtext + r'(?="\\")', pFilePath)
It runs OK in the Visual Studio Core but when I try it on my environment, I get this error:
parsing ............. - Too many )'s.
I am stuck with this. Is there a more clever way of doing this?