I am using a Powershell command in a Windows batch file to search for a text string like this: foo=1
(where 1 could be anything)
I know .*? works as a wildcard in Powershell. The below snippet isn't the full command, I have only put the relevant part.
I am trying to replace the whole line foo=1 with nothing, using the Powershell wildcard .*? for the 1 like this:
-replace 'foo=.*?', ''
The problem is, instead of being left with a blank line, I am still left with the trailing =1
I don't know why the wildcard is not being replaced with nothing as per the command in the code box above.
Thanks in advance to any answers that shed some light on it.