I have a task to write a C# application to parse an xml file. One of the attribute values in the file is a Replace statement and I have to parse it to create a PowerShell Replace statement. I'm using regex to do this. The string looks like this:
Replace(FileName, ".txt", ".doc")
I want to capture "FileName", ".txt" and ".doc"
My question is, how do I match against the open (left) parens AND the double-quotes ?
My issue is, I can't use
@"\"pattern\""
because the '@' symbol doesn't recognize the escaped double-quotes (in VS 2015). And if I remove the '@', then how do I escape the opening (left) parens ? I can't use
"\("
as an escape sequence b/c the compiler says, "unrecognized escape sequence".
Anyway, all help is appreciated.
@" double quotes "" "
– Jonesopolis