正規表現を使用して HTML ファイル内のコメントを照合し、C#.net (VS2010) ソリューションを使用してそれらを完全に削除しようとしています。コメントは次のようになります。
/*This flexibility is not available with most other programming languages. E.g. in Java,
the position for \G is remembered by the Matcher object.
The Matcher is strictly associated with a single regular expression and a single subject
string.*/
私は試しました/\*.+\*/
、
str = File.ReadAllText("Test.html");<br />
str = Regex.Replace(str, "/\*.+\*/", "", RegexOptions.Singleline);<br />
File.WriteAllText("Test.html", str);
しかし、彼らは私のために働いていませんでした. フォーラムでいくつかの回答をたどりましたが、まだ運がありません。
助けていただければ幸いです:)
ありがとう...