It was brought to my attention yesterday that there was a bug with the C# code generation feature inside Regex Hero. Thanks Blake for pointing it out . It turns out that I had made a stupid mistake in the way I was adding \r and \n to the string. I mostly rely on the @"string" literals because they're convenient and generally cleaner for what I need to do. But of course, the escaped notations \r and \n don't work inside those strings. So this has been updated this morning. From now on Regex Hero will generate C# strings more like this... @"line1" + "\n" + @"line2"