I가 C#
에 다음 코드 :
Regex.Escape() 알 수없는 예외
{"parsing \"\hello\" - Unrecognized escape sequence \h."}
가 나는 \ + (some names)
이 존재 할 때 필요한 : 나는 다음과 같은 오류가
String str = @"\hello ali how are you? are you fine? hello and hi";
Console.WriteLine(Regex.Matches(Regex.Escape(str), @"\hello").Count);
내 코드. 이스케이프 시퀀스 문자를 사용하지 않기 위해 @
을 사용했지만 언급 된 오류가 발생합니다. 왜 이런 일이 일어 나는지 나는 이해할 수 없다!
'Console.WriteLine (Regex.Matches (str, Regex.Escape (@ "\ hello")). Count); ' – dymanoid
정규식이 명령 \ h를 이해하지 못합니다. \ d +와 비슷합니다. – jdweng