using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\b\d{1,3}(?:,\d{2,3})*(?:,\d{3})*(?:\.\d+)?\b";
string input = @"problem satatement is to get all the amount despite of inconsistencies in comma or dollar sign also I need to exclude year from that (if no pattern can be made asssume to get all the amount greater than 3000)
$ 1,000,000.6522
$ 3,500,000
90,00,00,000
5000000
200
200,000
20,00,000
1,000
$ 4,000,000 for the 2023
800,000
90.65
5,555
5000
2021 --------this should be excluded from the pattern
89jfe90ABI900 ----this also should be excluded from the pattern";
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