5
데이터베이스에서 검색된 일부 패턴으로 정규식 패턴을 작성하려고합니다. 예를C#에서 동적 정규식 패턴 작성하기
string pt= "@\"\\b(" + db.GetPattern + ")\\b\"";
Regex regex = new Regex(pt, RegexOptions.IgnoreCase | RegexOptions.Compiled);
return regex.Replace(input, "*");
내가 탈출을 시도하지만, 내가이 일을 얻을 수 없었다 들어
. 수동으로 패턴을 빌드하면
Regex regex = new Regex(@"\b(test|test2)\b", RegexOptions.IgnoreCase | RegexOptions.Compiled);
return regex.Replace(input, "*");
과 같이 작동합니다.