using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?<!version"":"")(\d+\.\d+\.\d+\.\d+)";
string input = @"2018-09-15 15:59:41,311 INFO [Timer-0]-dashboard.PSDashboard: getProcessSummary --> processing output line
[32mOk: {""status"":200,""name"":""xya.com"",""version"":""1.1.2.371"",""cis"":""online"",""tagline"":""}[0m
2018-09-15 15:59:40,106 INFO [Timer-0]-util.SSHUtil: Connecting to host [10.60.9.59] using provided credentials.
2018-09-15 15:59:40,209 INFO [Timer-0]-util.SSHUtil: Connected to host [10.60.9.29] using provided credentials.
2018-09-15 15:59:40,209 INFO [Timer-0]-util.SSHUtil: Connected to host 10.60.9.34 using provided credentials.";
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