using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?m)(?:\d+\.){3}\d+$";
string input = @"4:16:09PM - xx yy DOS activity from 10.0.0.45
9:43:44PM - xx yy 1A disconnected from server
2:40:28AM - xx yy 1A connected
1:21:52AM - xx yy DOS activity from 192.168.123.4";
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