using System;
using System.Text.RegularExpressions;

namespace RegexTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = "CO < SUB > 1 </ SUB > 안녕 < SUB > 2 </ SUB > 하세요 < SUB > 3 </ SUB >";
            Console.WriteLine(str(input));
        }

        public static string str(string input) 
        {
            return Regex.Replace(input, @"<(.|\n)*?>", string.Empty);
        }
    }
}

 

[실행 결과]

+ Recent posts