using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(^|[+-]?\d+\.\d*)$";
string input = @"TICKER|LAST_UPDE|PX_LAST
EE0002M Index|20211231|-0.58814
US0002M Index||
USB3MAY Index|20220502|0.8x9
SOFRRATE Index|20220505|c0.79
FEDL01 Index|20220505|0.83
US0001M Index|2022050|0.84486
FDTR Index|20220505|1
US0003M Index|20220505|1.37071
PRIME Index|20220505|4
TICKER|LAST_UPDATE|PX_LAST
EE0002M Index|20211231|-0.58814
US0002M Index|20211231|0.1525
USB3MAY Index|20220502|0.89
PRIME Index|20220503|3.5
SOFRRATE Index|20220504|0.3
FEDL01 Index|20220504|0.33
US0001M Index|20220504|0.84514
FDTR Index|20220504|0.5
US0003M Index|20220504|1.40614
";
Match m = Regex.Match(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