Comment detail

/*コメント*/を取り除く (Nested Flatten)
上のと同じかも
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
using System;
using System.Text;
using System.Text.RegularExpressions;
class Program
{
  static void Main(string[] args)
  {
    string[] ss = {"AAA", "AAA/*/BBB", "AAA/*BBB", 
      "AAA/*BBB*/CCC", "AAA/*BBB/*CCC*/DDD*/EEE", "AAA/a//*BB*B**/CCC"};
    foreach (string s in ss)
      Console.WriteLine(Regex.Replace(Regex.Replace(s, "\\/\\*.*?\\*\\/", ""), "\\/\\*.*$", ""));
  }
}

Index

Feed

Other

Link

Pathtraq

loading...