Finding C#-style unescaped strings using regular expressions

Posted by possan on Stack Overflow See other posts from Stack Overflow or by possan
Published on 2010-02-19T11:12:58Z Indexed on 2010/05/16 10:50 UTC
Read the original article Hit count: 123

Filed under:
|
|

I'm trying to write a regular expression that finds C#-style unescaped strings, such as

string x = @"hello
world";

The problem I'm having is how to write a rule that handles double quotes within the string correctly, like in this example

string x = @"before quote ""junk"" after quote";

This should be an easy one, right?

© Stack Overflow or respective owner

Related posts about regex

Related posts about quotes