Regex regex = new Regex(@"(c=)|(c-)|(dz=)|(d-)|(lj)|(nj)|(s=)|(z=)"); //정규식
string input = regex.Replace(Console.ReadLine(),"1"); //1로 변환
Console.WriteLine(input.Length);
// -----------------------------------------------------------------------------------------------
string put = Console.ReadLine();
string[] crotia = new string[] { "c=", "c-", "dz=", "d-", "lj", "nj", "s=", "z=" }; //배열에 저장
for(int i = 0; i < crotia.Length; i++)
put = put.Replace(crotia[i],"1"); //일일이 Replace실행
Console.WriteLine(put.Length); //출력
위에꺼는 104ms << 직접 짠 코드
아래꺼는 60ms << 참고해서 돌려본 코드
Regex가 느리긴 하구나 느낌