I have created a regular expression on regex101 that works as expected, however the problem is that one part is apparently not valid in Powershell; the \K
.
Essentially I am looking for instances of a string, and returning the entire word after the instance of the string. So here is an example:
\btest\s+\K\S+
This finds every example of the word test
and returns the word after it. I did try experimenting with Lookaheads and Lookbehinds, while some of those do work, they are still either returning test
or additional unnecessary characters.
Is there a way to replicate the \K
in powershell? Or even better, any add-ons that will allow PowerShell to use the \K
?