using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(\d[ \-.)]{0,3}){11,20}|(\b[\d]{3}\b)[^,.]";
string input = @"1546
4 8 6 2 6 4 1 1 5 3 6 6 6 7 7 1
5378 2052 1163 1153
6011-7614 4775 1364
333 112,55 mdsksajfk
05536080
214
12/05
12/08
122sss 222222222222111 22464 222 222ss, 222,22 22.22 333215122 22 33 123456789012
122.44
445
1546
4 8 6 2 6 4 1 1 5 3 6 6 6 7 7 1
5378 2052 1163 1153
6011-7614 4775 1364
333 112,55 mdsksajfk
11947285580
(11)947285580
1194728-5580
11 94728 5580
346.549.668-32
46254966832
31604523875
10154511,55
12/56/12019";
foreach (Match m in Regex.Matches(input, pattern))
{
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