I am trying to write a regex to match a library in a file and the path containingg the file. All the libraries in the file will be in the format.
text = "mylib|C://desktop//baseicmylib.lib
randlib|C://desktop//randlib.lib"
so if I want to find mylib
I wrote
str = "mylib"
pattern = r'%s\\|.*lib'%str
mypath = re.findall(pattern,text)
Can some one help me where I am making a mistake.
It’s maybe no regex needed?
result: