I'm trying to extract a substring with Regex,
Here is my script:
import re
_text = "sdiskpart(device='D:\\', mountpoint='D:\\', fstype='FAT32', opts='rw,fixed')"
print(re.findall("device=(\\'.*\\')", _text))
I'm trying to get the value of device, in this string it's "D:\"
as u can see I tried "device=(\'.*\')" with REgex and it returned:
["'D:\', mountpoint='D:\', fstype='FAT32', opts='rw,fixed'"]
I'm not professional on REgex, How can I force it to take D:\ and print it out ?