using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"TOTALE EURO CONTANTI\s*\K\d+[.,]\d+";
string input = @"Del burger Sr Via Carlo del Prete 106/d 50127 FIRENZE C.F. E P.IVA 08380120482 BRUNCH MAMMAMIA ONION RINGS SPICCHI PATATE ACQUA 0.5L TAVOLO 88 EURO 6,50 6,50 4,00 3,00 1,00 TOTALE EURO CONTANTI 21,00 21,00 NR.0057 23/05/18 20:21 MF U1 72005985
Del burger Sr Via Carlo del Prete 106/d 50127 FIRENZE C.F. E P.IVA 08380120482 BRUNCH MAMMAMIA ONION RINGS SPICCHI PATATE ACQUA 0.5L TAVOLO 88 EURO 6,50 6,50 4,00 3,00 1,00 TOTALE EURO CONTANTI 21.00 21,00 NR.0057 23/05/18 20:21 MF U1 72005985";
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