using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?:\*+\w+\d+\*+)(\w+\s\w+)(?:\s[^\D]+\s)";
string input = @"random text 1***trash24***y6f dhy 63 month ago 14 minutes, 29 seconds 3,620 name***trash3***random text 1"",""random text 2***trash2***pot 5aq 3 months ago 9 minutes, 9 seconds 226,629 name***trash3***random text 2"",""random text 3***trash2***uan 4fp 5 months ago 26 minutes 506,950 name***trash3***random text 3""
и тут тоже $1 то что тебе нужно
";
RegexOptions options = RegexOptions.Multiline;
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