I have some data (to be precise this data comes from Windows Registry), which looks like that:
some data ... PACKAGE_SIZE REG_SZ 100000\r\n PATH REG_SZ C:\\Some\\path\r\n VERSION REG_SZ 1.0.0\r\n some other data...
I need to extract the path from it, so I use a regular expression like that:
(?<=(PATH.*?REG_SZ)).+?(?=\\r\\n)
But it doesn’t work, as I understand because the lookaround is atomic. So far I’m able to use something like that:
(?<=PATH).+?(?=\\r\\n)
what captures
REG_SZ C:\\Some\\path
My question is – is this possible to extract the path in one go? (It means without using two regular expressions)
You can try this way
output:
C:\Some\path