フォーマットする必要のあるクラスがいくつかあります。名前空間内にusingディレクティブを配置する必要があります。言い換えれば、私は変更する必要があります:
// some comment about system
using System;
using System.Collections.Generics; // needed to create lists
namespace MyNamespace
{
... code
の中へ:
namespace MyNamespace
{
// some comment about system
using System;
using System.Collections.Generics; // needed to create lists
... code
要するに、私は一致できるようにしたいと思います:
// some comment about system
using System;
using System.Collections.Generics; // needed to create lists
私がこれまで取り組んできたのは、この正規表現です。(?s)(//.*?(?=\r))(\r\n|^)*using .*?;
最初のグループ(//.*?(?=\r))(\r\n|^)
はコメントと一致します。ですので、ご利用にコメントがございましたら、そのコメントもお受けしたいと思います。*
コメントを0個以上にするために、グループの最後にを配置したことに注意してください。どういうわけか、2番目の使用法が一致しないのはなぜですか?