using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?sx)([ぁ-ゔ])(?=.*:\1=(.))";
string substitution = @"$2";
string input = @"このビルディングのベースメントはレストランとカフェがあります。
Dictionary:ぁ=ァ:あ=ア:ぃ=ィ:い=イ:ぅ=ゥ:う=ウ:ぇ=ェ:え=エ:ぉ=ォ:お=オ:か=カ:が=ガ:き=キ:ぎ=ギ:く=ク:ぐ=グ:け=ケ:げ=ゲ:こ=コ:ご=ゴ:さ=サ:ざ=ザ:し=シ:じ=ジ:す=ス:ず=ズ:せ=セ:ぜ=ゼ:そ=ソ:ぞ=ゾ:た=タ:だ=ダ:ち=チ:ぢ=ヂ:っ=ッ:つ=ツ:づ=ヅ:て=テ:で=デ:と=ト:ど=ド:な=ナ:に=ニ:ぬ=ヌ:ね=ネ:の=ノ:は=ハ:ば=バ:ぱ=パ:ひ=ヒ:び=ビ:ぴ=ピ:ふ=フ:ぶ=ブ:ぷ=プ:へ=ヘ:べ=ベ:ぺ=ペ:ほ=ホ:ぼ=ボ:ぽ=ポ:ま=マ:み=ミ:む=ム:め=メ:も=モ:ゃ=ャ:や=ヤ:ゅ=ュ:ゆ=ユ:ょ=ョ:よ=ヨ:ら=ラ:り=リ:る=ル:れ=レ:ろ=ロ:ゎ=ヮ:わ=ワ:ゐ=ヰ:ゑ=ヱ:を=ヲ:ん=ン:ゔ=ヴ:ヵ=ヵ:ヶ=ヶ:わ゙=ヷ:ゐ゙=ヸ:ゑ゙=ヹ:ヺ=ヺ";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx