Visual studio code under certain circumstances doesn't seem to match letters and I'm not sure if I'm missing something incredibly obvious or if this is a bug. In my case I'm standardizing a code base and I want to change things like:
}
else {
Write-Warning
to:
} else {
Write-Warning
I wrote the following regex:
((?:(?=[^\r\n])\s))\}
.*else \{
(there's a newline here you can't see)
to identify the lines I want to change. On one file it worked just fine:
However on the next file I got the following:
As you can see I changed the regex a bit, but it works as expected and matches everything up to and include the 'e'. However, if I add an l:
It no longer matches. I tried copying and pasting the 'l' thinking maybe it was some weird unicode problem or something - still doesn't match. Am I missing something?
Update
I checked the line endings with a hex editor and confirmed everything was only 0A
(LF). There were no carriage returns:
I also confirmed in Visual Studio code the line endings were set to LF.