Closed Yayroos closed 1 year ago
Hello @Yayroos,
You're right the message is a little confusing for .NET specifically, especially with going the raw string route.
To escape a "
you just prefix it with another "
, so: ""
Ok, but in C# the escape needed is a backslash, because the regex is just given in a string. "" just causes errors.
I believe it depends on the type of string you utilize. The site uses an @-string
.
Please see #1968 and let me know what you think. Thank you!
Thanks for pointing me to that. I suppose it's clear at this point that I'm not super familiar with C#. I've inherited a legacy codebase that needs a lot of work and this isn't my language of choice. Probably not within scope of the site itself to explain the difference in types of strings but perhaps linking to an explainer page elsewhere would be useful?
Using C#/.NET flavour, a regex string with a double quote in it unescaped gives an error that "An unescaped delimiter must be escaped; in most languages with a blackslash"
but escaping the quote with a backslash gives the error "This token has no special meaning and has this been rendered erroneous"