using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @".{1,}?([。.」??!!]+|\n)";
string input = @" そこは純白の空間だった。
四方の壁は継ぎ目の無い白塗り、中央に鎮座する祭壇も雪を固めたように真っ白で、この部屋を満たす光もまた白く輝いていた。
「供物を捧げよ」
どこからとも無く部屋中に響き渡る声。
開け放たれた両開きの扉、その暗い通路の向こうから人の列がやってくる。白い部屋と同じように、その人々もまた白尽くめであった。
染み一つ無い清潔な白いローブで全身を覆い、顔には白いマスクを被り、素肌を露出している部分が一切無い。";
RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
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