Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこのように定義された古いperl正規表現を持っています
my @data = split(/^[0-9]{1,3}\)?\t/m, $CLIP->GetText());
C#は正規表現が好きではなく、認識されないエスケープシーケンスを言いますか?どうすればこれを修正できますか?
私はこれをC#で試しました
Regex rex = new Regex("/^[0-9]{1,3}\)?\t/m");
問題は\)です。この問題を解決する最も簡単な方法は、文字列を次のような逐語的な文字列に変更することです。
\)
Regex rex = new Regex(@"^[0-9]{1,3}\)?\t");
また、この場合、スラッシュと末尾のmは必要ありません。