110,995
社区成员
发帖
与我相关
我的任务
分享
string input =
@"// Create the client. The code for the calculator client
// is not shown here. See the sample applications
// for examples of the calculator code.
CalculatorClient cc = new CalculatorClient(myBinding, myEndpointAddress); // create client
// Create the endpoint address.
/*
abcdefg
123354676890
*/";
var coll = Regex.Matches(input, @"//.+(?=\n)|/\*(.|\n)+?\*/");
foreach(Match m in coll)
{
Console.WriteLine(m.Value);
}
Console.ReadKey();
static void Main(string[] args)
{
#if false
/*"
#endif
//*//*"
Console.WriteLine("/*start comments");
Console.WriteLine("end comments*/");
Console.WriteLine("\"//hello */");
}