using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\b(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b";
string input = @"67.93.195.181
248.83.55.126
277.92.425.12
220.164.237.203
36.173.112.111
36.33.171.246
37.123.14.323
23.93.163.86
236.129.173.89
2.224.237.202
256.123.123.123
69.10.174.79
35.185.155.175
6.215.157.157
123.123.123.234
188.43.121.96
101.22.3.71
1.1.1.1
55.58.142.177
179.107.91.118";
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