using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\b(S5TIME|S5T|TIME|LTIME|T|LT|D|TOD|LTOD|DT|DTL|LDT)#[0-9|+|-]*([^(\s|;)]+)";
string input = @"DT#1990-01-01-00:00:00.000
DT#2089-12-31-23:59:59.999
LDT#1970-01-01-00:00:00.000000000
LDT#2262-04-11-23:47:16.854775807
DTL#1970-01-01-00:00:00.0
DTL#2262-04-11-23:47:16.854775807
LTOD#00:00:00.000000000
LTOD#23:59:59.999999999
TOD#00:00:00.000
TOD#23:59:59.999
D#1990-01-01
D#2169-06-06
LT#-106751d_23h_47m_16s_854ms_775us_808ns
LT#+106751d_23h_47m_16s_854ms_775us_807ns
LT#11350d_20h_25m_14s_830ms_652us_315ns
LTIME#11350d_20h_25m_14s_830ms_652us_315ns;
T#-24d_20h_31m_23s_648ms
T#+24d_20h_31m_23s_647ms
T#10d_20h_30m_20s_630ms
TIME#10d_20h_30m_20s_630ms
S5T#0MS
S5T#2H_46M_30S_0MS
S5T#10s
S5TIME#10s";
RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase;
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