Bug Regular Expression Filter operator '|' (or) does not work inside parenthesis ()

This is the code path I mentioned earlier, from source insepection (I don’t have a Linux debugger…) then retracted partially here becasue COMMANDLINE_ESCAPED_LINUX = new Regex(@"[""|$||\|!]");` seemed intending to do alternation via vertical bar, except vertical bar in a character class isn’t alternation, but it’s simply a vertical bar character. Fixing the Regex possibly would solve this issue, but the arg splitting isn’t obvious to me, I suspect mono does it differently than .NET Framework, and I’m not sure where the other backslashing got undone. I used a standalone version of the code to see them go in. How’d they get out?

Yes, you are quite right. This line should change:

To:

private static readonly Regex COMMANDLINE_ESCAPED_LINUX = new Regex(@"[""$`\\!]");

The regexp replace function is straightforward, where each match invokes the function, which can return a replacement string (or the matched string fragment).

No, they should (ideally) work exactly the same. The Windows commandline and the Linux/BSD shell escaping/expanding rules are very different though.

I have mered in the changes to this, and they will be part of the next canary build.

Great. That solution seems reasonable.